class StashCli < Formula desc "Command-line interface clients for Atlassian products" homepage "https://bobswift.atlassian.net/wiki/pages/viewpage.action?pageId=1966101" url "https://bobswift.atlassian.net/wiki/download/attachments/16285777/atlassian-cli-5.3.0-distribution.zip" version "5.3.0" sha256 "eb7139e700e023f01c02d12d9b88a8ec61315689195fac19bc1e5fcefdb6afff" bottle :unneeded depends_on :java => "1.7+" def install Dir.glob("*.sh") do |f| cmd = File.basename(f, ".sh") inreplace cmd + ".sh", "`dirname $0`", share bin.install cmd + ".sh" => cmd end share.install "lib", "license" end test do Dir.glob(bin/"*") do |f| cmd = File.basename(f, ".sh") assert_match "Usage:", shell_output(bin/"#{cmd} --help 2>&1 | head") unless cmd == "atlassian" end end end