|
1 | | -# Homebrew formula for domaindetails CLI |
2 | | -# To install: brew install simplebytes-com/tap/domaindetails |
| 1 | +# Homebrew formula for domaindetails CLI (homebrew-core version) |
| 2 | +# This formula builds from source as required by homebrew-core |
3 | 3 | # |
4 | | -# This formula is published to: https://github.com/simplebytes-com/homebrew-tap |
| 4 | +# For the tap version (prebuilt binaries), see: |
| 5 | +# https://github.com/simplebytes-com/homebrew-tap |
5 | 6 |
|
6 | 7 | class Domaindetails < Formula |
7 | | - desc "Domain RDAP and WHOIS lookup CLI tool" |
| 8 | + desc "Fast CLI tool for domain registration lookups via RDAP and WHOIS" |
8 | 9 | homepage "https://domaindetails.com" |
9 | | - version "1.0.0" |
| 10 | + url "https://github.com/simplebytes-com/domaindetails-cli/archive/refs/tags/v1.0.1.tar.gz" |
| 11 | + sha256 "a7ac0c70b6f3c10a2ca4840431a0b0c46927658a3512fcca093545dd0022dae7" |
10 | 12 | license "MIT" |
| 13 | + head "https://github.com/simplebytes-com/domaindetails-cli.git", branch: "main" |
11 | 14 |
|
12 | | - on_macos do |
13 | | - if Hardware::CPU.arm? |
14 | | - url "https://github.com/simplebytes-com/domaindetails-cli/releases/download/v#{version}/domaindetails-#{version}-darwin-arm64.tar.gz" |
15 | | - sha256 "REPLACE_WITH_ACTUAL_SHA256_FOR_DARWIN_ARM64" |
16 | | - else |
17 | | - url "https://github.com/simplebytes-com/domaindetails-cli/releases/download/v#{version}/domaindetails-#{version}-darwin-amd64.tar.gz" |
18 | | - sha256 "REPLACE_WITH_ACTUAL_SHA256_FOR_DARWIN_AMD64" |
19 | | - end |
20 | | - end |
21 | | - |
22 | | - on_linux do |
23 | | - if Hardware::CPU.arm? |
24 | | - url "https://github.com/simplebytes-com/domaindetails-cli/releases/download/v#{version}/domaindetails-#{version}-linux-arm64.tar.gz" |
25 | | - sha256 "REPLACE_WITH_ACTUAL_SHA256_FOR_LINUX_ARM64" |
26 | | - else |
27 | | - url "https://github.com/simplebytes-com/domaindetails-cli/releases/download/v#{version}/domaindetails-#{version}-linux-amd64.tar.gz" |
28 | | - sha256 "REPLACE_WITH_ACTUAL_SHA256_FOR_LINUX_AMD64" |
29 | | - end |
30 | | - end |
| 15 | + depends_on "go" => :build |
31 | 16 |
|
32 | 17 | def install |
33 | | - bin.install "domaindetails" |
| 18 | + ldflags = %W[ |
| 19 | + -s -w |
| 20 | + -X main.version=#{version} |
| 21 | + -X main.commit=#{tap.user} |
| 22 | + -X main.date=#{time.iso8601} |
| 23 | + ] |
| 24 | + system "go", "build", *std_go_args(ldflags:), "./cmd/domaindetails" |
34 | 25 | end |
35 | 26 |
|
36 | 27 | test do |
37 | | - system "#{bin}/domaindetails", "--version" |
| 28 | + assert_match "domaindetails", shell_output("#{bin}/domaindetails --help") |
| 29 | + assert_match version.to_s, shell_output("#{bin}/domaindetails --version") |
38 | 30 | end |
39 | 31 | end |
0 commit comments