2019-10-07 08:29:38 +00:00
|
|
|
class ArduinoCli < Formula
|
|
|
|
desc "Arduino command-line interface"
|
|
|
|
homepage "https://github.com/arduino/arduino-cli"
|
2019-10-08 08:13:28 +00:00
|
|
|
url "https://github.com/arduino/arduino-cli.git",
|
2019-10-24 10:44:08 +00:00
|
|
|
:tag => "0.6.0",
|
|
|
|
:revision => "3a08b07d458ef65fdefe88a7d71056227f626f5a"
|
2019-10-08 08:13:28 +00:00
|
|
|
head "https://github.com/arduino/arduino-cli.git"
|
2019-10-07 08:29:38 +00:00
|
|
|
|
2019-10-07 08:36:02 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2019-10-27 20:35:36 +00:00
|
|
|
sha256 "878a5c5b6b9c25e1e1a7d703876dda604cae63a3efee21039e6d3ba44f43eb43" => :mojave
|
|
|
|
sha256 "d96cc41349e79283cc17ab01ef2643badb8f835c38a6e1d6873a0aa35ed97bfc" => :high_sierra
|
2019-10-07 08:36:02 +00:00
|
|
|
end
|
|
|
|
|
2019-10-07 08:29:38 +00:00
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
def install
|
2019-10-08 08:13:28 +00:00
|
|
|
commit = Utils.popen_read("git", "rev-parse", "HEAD").chomp
|
2019-10-15 08:08:50 +00:00
|
|
|
system "go", "build", "-ldflags",
|
|
|
|
"-s -w -X github.com/arduino/arduino-cli/version.versionString=#{version} " \
|
|
|
|
"-X github.com/arduino/arduino-cli/version.commit=#{commit}",
|
|
|
|
"-o", bin/"arduino-cli"
|
2019-10-07 08:29:38 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system "#{bin}/arduino-cli", "sketch", "new", "test_sketch"
|
2019-10-24 10:44:08 +00:00
|
|
|
assert File.directory?("#{testpath}/test_sketch")
|
2019-10-07 08:29:38 +00:00
|
|
|
end
|
|
|
|
end
|