aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/datomic.rb
blob: a6b985b7c7340cd577f607671eca3c772b33cb7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require 'formula'

class Datomic < Formula
  homepage 'http://www.datomic.com/'
  url "http://downloads.datomic.com/0.8.4218/datomic-free-0.8.4218.zip"
  sha1 'e7de3c55900b6caae7b66b62581d6c53e9993858'

  def write_libexec_alias *script_names
    script_names.each do |script_name|
      alias_name = script_name == 'datomic' ? 'datomic' : "datomic-#{script_name}"
      (bin + alias_name).write <<-EOS.undent
        #!/bin/bash
        cd #{libexec} && exec "bin/#{script_name}" "$@"
      EOS
    end
  end

  def install
    libexec.install Dir['*']
    write_libexec_alias 'datomic', 'transactor', 'repl', 'repl-jline', 'rest', 'shell'
  end

  def caveats
    <<-EOS.undent
      You may need to set JAVA_HOME:
        export JAVA_HOME="$(/usr/libexec/java_home)"
      All commands have been installed with the prefix 'datomic-'.
    EOS
  end
end