Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions Formula/gamon3.rb
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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