Skip to content

Commit

Permalink
Merge pull request #179266 from Homebrew/gh-version-head
Browse files Browse the repository at this point in the history
gh: improve `version` output for `HEAD`
  • Loading branch information
carlocab authored Aug 1, 2024
2 parents fd595fb + d25cf6b commit 3f7c3ac
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Formula/g/gh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ class Gh < Formula
url "https://github.com/cli/cli/archive/refs/tags/v2.53.0.tar.gz"
sha256 "5e47d567216b1f63a4939e634f9067c9b60b0852625edf8ad10e1b9be5033cff"
license "MIT"

head "https://github.com/cli/cli.git", branch: "trunk"

livecheck do
Expand All @@ -27,8 +26,14 @@ class Gh < Formula
deny_network_access! [:postinstall, :test]

def install
gh_version = if build.stable?
version.to_s
else
Utils.safe_popen_read("git", "describe", "--tags", "--dirty").chomp
end

with_env(
"GH_VERSION" => version.to_s,
"GH_VERSION" => gh_version,
"GO_LDFLAGS" => "-s -w -X main.updaterEnabled=cli/cli",
) do
system "make", "bin/gh", "manpages"
Expand Down

0 comments on commit 3f7c3ac

Please sign in to comment.