diff --git a/.github/workflows/linter-full.yml b/.github/workflows/linter-full.yml index f8af30c..e317c66 100644 --- a/.github/workflows/linter-full.yml +++ b/.github/workflows/linter-full.yml @@ -31,5 +31,6 @@ jobs: VALIDATE_ALL_CODEBASE: true VALIDATE_JSCPD: false VALIDATE_GO: false + VALIDATE_RUBY: false FILTER_REGEX_EXCLUDE: .*\.github/linters/\.golangci\.yml GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/linter-pr.yml b/.github/workflows/linter-pr.yml index 647714a..e7feab0 100644 --- a/.github/workflows/linter-pr.yml +++ b/.github/workflows/linter-pr.yml @@ -31,5 +31,6 @@ jobs: VALIDATE_ALL_CODEBASE: false VALIDATE_JSCPD: false VALIDATE_GO: false + VALIDATE_RUBY: false FILTER_REGEX_EXCLUDE: .*\.github/linters/\.golangci\.yml GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/Formula/hctl.rb b/Formula/hctl.rb new file mode 100644 index 0000000..d21e03b --- /dev/null +++ b/Formula/hctl.rb @@ -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 diff --git a/README.md b/README.md index f438a66..b19c5d9 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,13 @@ And here we are! ## Install +### Homebrew + +```bash +brew tap xx4h/hctl +brew install xx4h/hctl/hctl +``` + ### asdf ```bash