42 lines
1.6 KiB
Ruby
42 lines
1.6 KiB
Ruby
require "language/node"
|
|
|
|
class AtomistCli < Formula
|
|
desc "The Atomist CLI"
|
|
homepage "https://github.com/atomist/cli#readme"
|
|
url "https://registry.npmjs.org/@atomist/cli/-/@atomist/cli-1.6.1.tgz"
|
|
sha256 "b39f35a9fb3df8e994840f381848f4cc3d209c8d10da315d314e3aa2ae03e643"
|
|
|
|
bottle do
|
|
sha256 "c574d452f970fc3df0bca1a2685cb229f748e518392ba43f40cd028d98cbe267" => :mojave
|
|
sha256 "3973e2676c80140591173fa11d6851cb55fe6cadf5ee20edfccf5a19e1b7ae09" => :high_sierra
|
|
sha256 "a79beee7222ab189792d443180cf5f3c5b615c13258815c36fd6809ad6fd568f" => :sierra
|
|
end
|
|
|
|
depends_on "node"
|
|
|
|
def install
|
|
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
|
|
bin.install_symlink Dir["#{libexec}/bin/*"]
|
|
bash_completion.install "#{libexec}/lib/node_modules/@atomist/cli/assets/bash_completion/atomist"
|
|
end
|
|
|
|
test do
|
|
assert_predicate bin/"atomist", :exist?
|
|
assert_predicate bin/"atomist", :executable?
|
|
assert_predicate bin/"@atomist", :exist?
|
|
assert_predicate bin/"@atomist", :executable?
|
|
|
|
run_output = shell_output("#{bin}/atomist 2>&1", 1)
|
|
assert_match "Not enough non-option arguments", run_output
|
|
assert_match "Specify --help for available options", run_output
|
|
|
|
version_output = shell_output("#{bin}/atomist --version")
|
|
assert_match "@atomist/cli", version_output
|
|
assert_match "@atomist/sdm ", version_output
|
|
assert_match "@atomist/sdm-core", version_output
|
|
assert_match "@atomist/sdm-local", version_output
|
|
|
|
skill_output = shell_output("#{bin}/atomist show skills")
|
|
assert_match(/\d+ commands are available from \d+ connected SDMs/, skill_output)
|
|
end
|
|
end
|