Add Formula for ahoy: A tool for making cli apps from yaml configs.
See https://github.com/ahoy-cli/ahoy Sponsored by Vimeo Closes #36128. Signed-off-by: Claudia <claui@users.noreply.github.com>
This commit is contained in:
parent
c65e2f83d9
commit
9877ab76a6
1 changed files with 41 additions and 0 deletions
41
Formula/ahoy.rb
Normal file
41
Formula/ahoy.rb
Normal file
|
@ -0,0 +1,41 @@
|
|||
class Ahoy < Formula
|
||||
desc "Creates self documenting CLI programs from commands in YAML files"
|
||||
homepage "http://www.ahoycli.com/"
|
||||
url "https://github.com/ahoy-cli/ahoy/archive/2.0.0.tar.gz"
|
||||
sha256 "cc3e426083bf7b7309e484fa69ed53b33c9b00adf9be879cbe74c19bdaef027c"
|
||||
|
||||
depends_on "go" => :build
|
||||
|
||||
def install
|
||||
ENV["GOPATH"] = buildpath
|
||||
bin_path = buildpath/"src/github.com/ahoy-cli/ahoy"
|
||||
bin_path.install Dir["*"]
|
||||
cd bin_path do
|
||||
system "go", "build", "-o", bin/"ahoy", "-ldflags", "-X main.version=#{version}", "."
|
||||
end
|
||||
end
|
||||
|
||||
def caveats; <<~EOS
|
||||
===== UPGRADING FROM 1.x TO 2.x =====
|
||||
|
||||
If you are upgrading from ahoy 1.x, note that you'll
|
||||
need to upgrade your ahoyapi settings in your .ahoy.yml
|
||||
files to 'v2' instead of 'v1'.
|
||||
|
||||
See other changes at:
|
||||
|
||||
https://github.com/ahoy-cli/ahoy
|
||||
|
||||
EOS
|
||||
end
|
||||
|
||||
test do
|
||||
(testpath/".ahoy.yml").write <<~EOS
|
||||
ahoyapi: v2
|
||||
commands:
|
||||
hello:
|
||||
cmd: echo "Hello Homebrew!"
|
||||
EOS
|
||||
assert_equal "Hello Homebrew!\n", `#{bin}/ahoy hello`
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue