Skip to content

Commit 17026f1

Browse files
committed
Add homebrew-core formula (source build)
1 parent d2dccef commit 17026f1

1 file changed

Lines changed: 18 additions & 26 deletions

File tree

Formula/domaindetails.rb

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,31 @@
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
33
#
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
56

67
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"
89
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"
1012
license "MIT"
13+
head "https://github.com/simplebytes-com/domaindetails-cli.git", branch: "main"
1114

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
3116

3217
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"
3425
end
3526

3627
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")
3830
end
3931
end

0 commit comments

Comments
 (0)