Skip to content

Instantly share code, notes, and snippets.

@mattmc3
Created April 29, 2019 13:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattmc3/722f26b845d3f69c264f06f21bd6f727 to your computer and use it in GitHub Desktop.
Save mattmc3/722f26b845d3f69c264f06f21bd6f727 to your computer and use it in GitHub Desktop.
Homebrew - Tap for private repo
# Homebrew formula for private github repo
# Requires $HOMEBREW_GITHUB_API_TOKEN to be set
# WARNING: This is a cheap way to do this. Don't use this method unless you
# really don't care about the security of you private GH token. And, let's
# be clear - this is for a private GH Enterprise repo, so you might not
# care...
class MyApp < Formula
desc "My fake app"
homepage "https://git.mycompany.com/myteam/myapp"
url "https://#{ENV['HOMEBREW_GITHUB_API_TOKEN']}@git.mycompany.com/group/repo/releases/download/v1.0.0.tar.gz"
sha256 "3c88af48a3bafcda0dd168dfa7efa0a304d9751e316b4b9bad5b65eb29b8f762"
head "https://git.mycompany.com/myteam/myapp.git"
bottle :unneeded
def install
bin.install "myapp"
end
def caveats; <<~EOS
Whatever you want to say here
EOS
end
test do
assert_match "myapp version 1.0.0", shell_output("#{bin}/myapp -v", 2)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment