-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
misc: add support to install with homebrew (#56)
for now we provide homebrew formula from within xx4h/hctl github repo, as we need at least 30 watchers, 30 forks, or 75 stars on the xx4h/hctl repostory until we can add the formula to Homebrew/homebrew-core
- Loading branch information
Showing
4 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
class Hctl < Formula | ||
desc "Tool to control your Home Assistant devices from the command-line" | ||
homepage "https://github.com/xx4h/hctl" | ||
url "https://github.com/xx4h/hctl.git", | ||
tag: "v0.4.0", | ||
revision: "e4fc037a284d28a7519ac1512d5201a2620ff623" | ||
license "Apache-2.0" | ||
head "https://github.com/xx4h/hctl.git", branch: "main" | ||
|
||
livecheck do | ||
url :stable | ||
regex(/^v?(\d+(?:\.\d+)+)$/i) | ||
end | ||
|
||
depends_on "go" => :build | ||
|
||
def install | ||
ldflags = %W[ | ||
-s -w | ||
-X github.com/xx4h/hctl/cmd.version=v#{version} | ||
-X github.com/xx4h/hctl/cmd.commit=#{Utils.git_head} | ||
-X github.com/xx4h/hctl/cmd.date=#{time.iso8601} | ||
] | ||
system "go", "build", *std_go_args(ldflags:) | ||
|
||
generate_completions_from_executable(bin/"hctl", "completion") | ||
end | ||
|
||
test do | ||
assert_match "Hctl is a CLI tool to control your home automation", shell_output("#{bin}/hctl --help") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters