|
| 1 | +class Tock < Formula |
| 2 | + desc "Powerful time tracking tool for the command-line" |
| 3 | + homepage "https://github.com/kriuchkov/tock" |
| 4 | + url "https://github.com/kriuchkov/tock/archive/refs/tags/v1.6.2.tar.gz" |
| 5 | + sha256 "bd43b2d3e59845cde23de2930b5e9067ca7a4113b28dc2a04b02b635b743032c" |
| 6 | + license "GPL-3.0-or-later" |
| 7 | + head "https://github.com/kriuchkov/tock.git", branch: "master" |
| 8 | + |
| 9 | + bottle do |
| 10 | + sha256 cellar: :any_skip_relocation, arm64_tahoe: "24601228020b270619768ce4395a1639a199967918a026c81ccbf23c8dc30577" |
| 11 | + sha256 cellar: :any_skip_relocation, arm64_sequoia: "24601228020b270619768ce4395a1639a199967918a026c81ccbf23c8dc30577" |
| 12 | + sha256 cellar: :any_skip_relocation, arm64_sonoma: "24601228020b270619768ce4395a1639a199967918a026c81ccbf23c8dc30577" |
| 13 | + sha256 cellar: :any_skip_relocation, sonoma: "56d6adc6e5f5e5e01d2d8833e04df282e2007c9981e73b706735c60a74a58600" |
| 14 | + sha256 cellar: :any_skip_relocation, arm64_linux: "1e86ecbd9ef88b516d2c8a1ec5776864c2ad99d8c45c1a70b2439c5c5d92958f" |
| 15 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "3a5082cdc1e8fc4b3db91b85d73da812c17e717fda57bb671dba3bc4ae2d8e3a" |
| 16 | + end |
| 17 | + |
| 18 | + depends_on "go" => :build |
| 19 | + |
| 20 | + def install |
| 21 | + ldflags = %W[ |
| 22 | + -s -w |
| 23 | + -X github.com/kriuchkov/tock/internal/adapters/cli.version=#{version} |
| 24 | + -X github.com/kriuchkov/tock/internal/adapters/cli.commit=#{tap.user} |
| 25 | + -X github.com/kriuchkov/tock/internal/adapters/cli.date=#{Date.today} |
| 26 | + ] |
| 27 | + |
| 28 | + system "go", "build", *std_go_args(ldflags:), "./cmd/tock" |
| 29 | + |
| 30 | + generate_completions_from_executable(bin/"tock", shell_parameter_format: :cobra) |
| 31 | + end |
| 32 | + |
| 33 | + test do |
| 34 | + assert_match version.to_s, shell_output("#{bin}/tock --version") |
| 35 | + assert_match "No currently running activities", shell_output("#{bin}/tock current") |
| 36 | + end |
| 37 | +end |
0 commit comments