Skip to content

Commit

Permalink
Merge pull request #73 from overmindtech/ServiceVersion
Browse files Browse the repository at this point in the history
Follow the new way of injecting the version into the binary
  • Loading branch information
DavidS-ovm authored Jan 7, 2025
2 parents 88899ba + 688cea7 commit 9f8b763
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Formula/overmind-cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ class OvermindCli < Formula
depends_on "go" => :build

def install
# Write the version of the package to a file so that it can be compiled into
# the binary
# Write the version of the package to an embedded file so that previous
# versions can be compiled.
File.write("tracing/commit.txt", "v#{version}-brew")
File.write("cmd/commit.txt", "v#{version}-brew")

system "go", "build", *std_go_args(ldflags: "-s -w", output: "overmind")
# Compile the correct version into the binary
system "go", "build", *std_go_args(ldflags: "-s -w -X github.com/overmindtech/cli/tracing.ServiceVersion=v#{version}-brew", output: "overmind")

bin.install "overmind"
end
Expand Down

0 comments on commit 9f8b763

Please sign in to comment.