From fbe353c53588cde58d3c240656c3823f128e2df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Fri, 8 Nov 2019 14:18:28 +0100 Subject: [PATCH] gh formula fixes - keep `head` spec to allow `--HEAD` installs from "prototype" git branch - explicitly specify `version` because Homebrew failed to infer version number from `url` - bring back bash/zsh completion support because the feature exists both in latest master and prototype, it just needs a newer tag - add TODO block for future Linux release --- Formula/gh.rb | 21 ++++++++++++++++++--- README.md | 21 +++++++++++++++------ 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/Formula/gh.rb b/Formula/gh.rb index e2fb7f7..259226f 100644 --- a/Formula/gh.rb +++ b/Formula/gh.rb @@ -1,12 +1,27 @@ class Gh < Formula desc "GitHub CLI" - url "https://github.com/github/homebrew-gh/releases/download/v0.0.195/gh-cli_0.0.195_darwin_amd64.tar.gz" - sha256 "82f8c50415d14851d3fb1a800ffd047f181880deb5450acd67bc7594fa2a19ea" + homepage "https://github.com/github/gh-cli" + version "0.0.195" + + if OS.mac? + url "https://github.com/github/homebrew-gh/releases/download/v0.0.195/gh-cli_0.0.195_darwin_amd64.tar.gz" + sha256 "82f8c50415d14851d3fb1a800ffd047f181880deb5450acd67bc7594fa2a19ea" + elsif OS.linux? + # TODO + end + + head do + url "https://github.com/github/gh-cli.git", :branch => "prototype" + depends_on "go" + end bottle :unneeded def install - bin.install "gh" + 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 diff --git a/README.md b/README.md index 462e6cc..e41c74a 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Homebrew tap for GitHub CLI -First-time: +Installation: ```sh -brew install github/homebrew-gh/gh +brew install github/gh/gh ``` That's it. You are now ready to use `gh`. 🥳 @@ -21,10 +21,19 @@ Available Commands: pr Work with pull requests ``` -To stay up to date with `gh` development: +Thank you for trying out GitHub CLI! 🌟 -```sh -brew upgrade gh +### Development version (restricted access) + +You can get access to features that are not yet in the stable release by +building the development version: + +``` +brew install github/gh/gh --HEAD ``` -Thank you for testing GitHub CLI! 🌟 +To upgrade it: + +``` +brew upgrade gh --fetch-HEAD +```