2016-08-23 09:17:39 +00:00
|
|
|
class LeanCli < Formula
|
|
|
|
desc "Command-line tool to develop and manage LeanCloud apps."
|
|
|
|
homepage "https://github.com/leancloud/lean-cli"
|
2016-11-03 06:59:35 +00:00
|
|
|
url "https://github.com/leancloud/lean-cli/archive/v0.4.1.tar.gz"
|
|
|
|
sha256 "9274be5d52b2e8eea6b8a8a5de90e6e6ecd9c0f2aa6562003809ed99bb2a251b"
|
2016-08-23 09:17:39 +00:00
|
|
|
head "https://github.com/leancloud/lean-cli.git"
|
|
|
|
|
2016-08-25 06:23:12 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2016-11-03 07:04:13 +00:00
|
|
|
sha256 "df4743e06db3ccb7b1aea71d39936a48af3ab7db4315d6d0bc26b12c33ea94d6" => :sierra
|
|
|
|
sha256 "8fde0e1b89d9cc5d891600a5f828ea63a6c66d3defc0624c6f2d7f13899bcff8" => :el_capitan
|
|
|
|
sha256 "251a73ab8682b3eac5cc3a18052410ea529d55a1e0c98b495a4bd1501930128b" => :yosemite
|
2016-08-25 06:23:12 +00:00
|
|
|
end
|
|
|
|
|
2016-08-23 09:17:39 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
build_from = build.head? ? "homebrew-head" : "homebrew"
|
|
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
mkdir_p buildpath/"src/github.com/leancloud/"
|
|
|
|
ln_s buildpath, buildpath/"src/github.com/leancloud/lean-cli"
|
|
|
|
system "go", "build", "-o", bin/"lean",
|
|
|
|
"-ldflags", "-X main.pkgType=#{build_from}",
|
|
|
|
"github.com/leancloud/lean-cli/lean"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
assert_match "lean version #{version}", shell_output("#{bin}/lean --version")
|
|
|
|
end
|
|
|
|
end
|