aboutsummaryrefslogtreecommitdiff
path: root/goss.rb
blob: 380e8db7d1297d066b435a1bbdf9bbf36748bbd0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
class Goss < Formula
  desc "Quick and Easy server testing/validation"
  homepage "https://goss.rocks"
  url "https://github.com/goss-org/goss/archive/refs/tags/v0.3.20.tar.gz"
  sha256 "5330d62826261533c8b1474799d9bc932fd50977e6f5a193b72244e0aaaf8946"
  license "Apache-2.0"
  head "https://github.com/goss-org/goss.git", branch: "master"

  depends_on "go" => [:build]

  def install
    ldflags = "-s -w"
    ldflags += if build.head?
      " -X main.version=#{Utils.git_head}"
    else
      " -X main.version=v#{version}"
    end

    system "go", "build", "-ldflags", ldflags, "-o", bin/"goss", "./cmd/goss"
  end
end