Skip to content

Commit

Permalink
asdf 0.16.0
Browse files Browse the repository at this point in the history
asdf v0.16.0 has been released. It is a complete rewrite in Go. Because of the
change of language, the build and install process changes significantly. Overall
the formula is more straightforward now and more in line with the numerous other
Go tools distributed via Homebrew.
  • Loading branch information
Stratus3D committed Jan 30, 2025
1 parent f933af4 commit 1752931
Showing 1 changed file with 7 additions and 28 deletions.
35 changes: 7 additions & 28 deletions Formula/a/asdf.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class Asdf < Formula
desc "Extendable version manager with support for Ruby, Node.js, Erlang & more"
homepage "https://asdf-vm.com/"
url "https://github.com/asdf-vm/asdf/archive/refs/tags/v0.15.0.tar.gz"
sha256 "d0cafe61d27b5e3fcb53658821bfbf744fd040a8ea28b0e22277e032b8e8f7fe"
url "https://github.com/asdf-vm/asdf/archive/refs/tags/v0.16.0.tar.gz"
sha256 "e2df22d3943911eec5b2d095d8a89a55cc7da912095d3f806619fd597201b124"
license "MIT"
head "https://github.com/asdf-vm/asdf.git", branch: "master"

Expand All @@ -16,38 +16,17 @@ class Asdf < Formula
sha256 cellar: :any_skip_relocation, all: "a94dd362ce5c3a818f4fa56607eac3c616a3c1191e9f41480093bda2dc308af4"
end

depends_on "autoconf"
depends_on "automake"
depends_on "coreutils"
depends_on "libtool"
depends_on "libyaml"
depends_on "go" => :build

depends_on "openssl@3"
depends_on "readline"
depends_on "unixodbc"

def install
bash_completion.install "completions/asdf.bash" => "asdf"
fish_completion.install "completions/asdf.fish"
zsh_completion.install "completions/_asdf"
libexec.install Dir["*"]

bin.write_exec_script libexec/"bin/asdf"
end

def caveats
<<~EOS
To use asdf, add the following line (or equivalent) to your shell profile
e.g. ~/.profile or ~/.zshrc:
. #{opt_libexec}/asdf.sh
e.g. ~/.config/fish/config.fish
source #{opt_libexec}/asdf.fish
Restart your terminal for the settings to take effect.
EOS
system("go", "build", *std_go_args(ldflags: "-s -X main.version=#{version}"), "./cmd/asdf")
generate_completions_from_executable(bin/"asdf", "completion")
end

test do
assert_match version.to_s, shell_output("#{bin}/asdf version")
output = shell_output("#{bin}/asdf plugin-list 2>&1")
assert_match "No plugins installed", output
assert_match "No plugins installed", shell_output("#{bin}/asdf plugin list 2>&1")
end
end

0 comments on commit 1752931

Please sign in to comment.