homebrew-core/Formula/gitversion.rb
Artur Stolear cb074f874f gitversion 5.1.3
Closes #48195.

Signed-off-by: Alexander Bayandin <a.bayandin@gmail.com>
2019-12-22 20:15:51 +00:00

27 lines
875 B
Ruby

class Gitversion < Formula
desc "Easy semantic versioning for projects using Git"
homepage "https://github.com/GitTools/GitVersion"
url "https://github.com/GitTools/GitVersion/releases/download/5.1.3/gitversion-osx-5.1.3.tar.gz"
sha256 "ae885c7eaf58f8af2350c4a8b258095bd6059f606d2b3bb6d6c9420b404f8545"
bottle :unneeded
def install
libexec.install Dir["*"]
(bin/"gitversion").write <<~EOS
#!/bin/sh
exec "#{libexec}/GitVersion" "$@"
EOS
end
test do
# Circumvent GitVersion's build server detection scheme:
ENV["JENKINS_URL"] = nil
(testpath/"test.txt").write("test")
system "git", "init"
system "git", "add", "test.txt"
system "git", "commit", "-q", "--author='Test <test@example.com>'", "--message='Test'"
assert_match '"FullSemVer":"0.1.0+0"', shell_output("#{bin}/gitversion -output json")
end
end