diff --git a/Formula/gamon3.rb b/Formula/gamon3.rb index 7fe8c19..a3a1f62 100644 --- a/Formula/gamon3.rb +++ b/Formula/gamon3.rb @@ -1,8 +1,8 @@ class Gamon3 < Formula desc "Automatically switch GitHub CLI account on `cd`" homepage "https://github.com/peter-bread/gamon3" - url "https://github.com/peter-bread/gamon3/archive/refs/tags/v2.0.0.tar.gz" - sha256 "f40a44b38f4e30a9e33034ced8db1772e79eedb56c9b8e3e28cfec7e90bbb7e1" + url "https://github.com/peter-bread/gamon3/archive/refs/tags/v2.0.3.tar.gz" + sha256 "b414609f40859aa1c5b6cbe14ace84c784c713b88d5d23da404e5dac00363509" license "MIT" head "https://github.com/peter-bread/gamon3.git", branch: "main" @@ -21,18 +21,24 @@ def install Utils.safe_popen_read("git", "describe", "--tags", "--dirty").chomp end - ldflags = %W[ - -s -w - -X main.version=#{gamon3_version} - ] - - system "go", "build", *std_go_args(ldflags: ldflags), "-o", "bin/gamon3" + with_env( + "GAMON3_VERSION" => gamon3_version, + ) do + system "make" + end bin.install "bin/gamon3" - generate_completions_from_executable(bin/"gamon3", "completion") end test do - assert_match "gamon3 version #{version}", shell_output("#{bin}/gamon3 --version") + os = OS.mac? ? "darwin" : "linux" + arch_raw = Hardware::CPU.arch + + arch = case arch_raw + when :x86_64 then "amd64" + else arch.to_s + end + + assert_match "gamon3 version #{version} #{os}-#{arch}", shell_output("#{bin}/gamon3 --version") end end