diff --git a/Formula/asdf.rb b/Formula/asdf.rb index 7543ed1a5d5b8..52e32907a5057 100644 --- a/Formula/asdf.rb +++ b/Formula/asdf.rb @@ -4,30 +4,48 @@ class Asdf < Formula url "https://github.com/asdf-vm/asdf/archive/v0.8.0.tar.gz" sha256 "9b667ca135c194f38d823c62cc0dc3dbe00d7a9f60caa0c06ecb3047944eadfa" license "MIT" - revision 1 + revision 2 head "https://github.com/asdf-vm/asdf.git" bottle :unneeded - - depends_on "autoconf" - depends_on "automake" depends_on "coreutils" - depends_on "libtool" - depends_on "libyaml" - depends_on "openssl@1.1" - depends_on "readline" - depends_on "unixodbc" - - conflicts_with "homeshick", - because: "asdf and homeshick both install files in lib/commands" + depends_on "git" def install bash_completion.install "completions/asdf.bash" fish_completion.install "completions/asdf.fish" zsh_completion.install "completions/_asdf" - libexec.install "bin/private" - prefix.install Dir["*"] - touch prefix/"asdf_updates_disabled" + libexec.install Dir["*"] + touch libexec/"asdf_updates_disabled" + bin.write_exec_script (opt_libexec/"bin/asdf") + (prefix/"asdf.sh").write ". #{opt_libexec}/asdf.sh\n" + (prefix/"asdf.fish").write "source #{opt_libexec}/asdf.fish\n" + end + + def post_install + system bin/"asdf", "reshim" + end + + def caveats + <<~EOS + Add shims in $PATH by having the following line your #{shell_profile}: + export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH" + If you use Fish shell add the following line to your ~/.config/fish/config.fish: + set PATH ( + if test -n "$ASDF_DATA_DIR" + echo $ASDF_DATA_DIR/shims + else + echo $HOME/.asdf/shims + end + ) $PATH + + To support package version per session using asdf shell + Add the following line to your #{shell_profile} file: + . #{opt_libexec}/lib/asdf.sh + If you use Fish shell add the following line to your ~/.config/fish/config.fish: + source #{opt_libexec}/lib/asdf.fish + Restart your terminal for the settings to take effect. + EOS end test do