зеркало из https://github.com/github/homebrew-gh.git
32 строки
815 B
Ruby
32 строки
815 B
Ruby
class Gh < Formula
|
|
desc "GitHub CLI"
|
|
homepage "https://github.com/github/gh-cli"
|
|
version "0.4.0"
|
|
|
|
if OS.mac?
|
|
url "https://github.com/probablycorey/homebrew-gghh/releases/download/v0.4.0/gh_0.4.0_macOS_amd64.tar.gz"
|
|
sha256 "85f9b895aab95c9882dfdb55193f9330514ab6e80777a972da04483c7a117010"
|
|
elsif OS.linux?
|
|
# TODO
|
|
end
|
|
|
|
head do
|
|
url "https://github.com/github/gh-cli.git", :branch => "master"
|
|
depends_on "go"
|
|
end
|
|
|
|
bottle :unneeded
|
|
|
|
def install
|
|
system "make" if build.head?
|
|
bin.install File.exist?("bin/gh") ? "bin/gh" : "gh"
|
|
(bash_completion/"gh.sh").write `#{bin}/gh completion -s bash`
|
|
(zsh_completion/"_gh").write `#{bin}/gh completion -s zsh`
|
|
end
|
|
|
|
test do
|
|
help_text = shell_output("#{bin}/gh --help")
|
|
assert_includes help_text, "Usage:"
|
|
end
|
|
end
|