Skip to content

Commit 8a0af73

Browse files
authored
build: update homebrew workflow to address stylistic requirements (#449)
Signed-off-by: Ben Stickel <ben.stickel@elastic.co>
1 parent 2c47140 commit 8a0af73

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

build/mage/release/formula.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import (
2929
"github.com/elastic/harp/build/artifact"
3030
)
3131

32-
var formulaTemplate = strings.TrimSpace(`# typed: false
32+
var formulaTemplate = `# typed: false
3333
# frozen_string_literal: true
3434
3535
# Code generated by Harp build tool
@@ -85,15 +85,14 @@ class {{ .Formula }} < Formula
8585
else
8686
bin.install "{{ .Bin }}-linux-arm-6" => "{{ .Bin }}"
8787
end
88-
else
89-
if Hardware::CPU.is_64_bit?
90-
bin.install "{{ .Bin }}-linux-amd64-v1" => "{{ .Bin }}"
91-
end
88+
elsif Hardware::CPU.is_64_bit?
89+
bin.install "{{ .Bin }}-linux-amd64-v1" => "{{ .Bin }}"
9290
end
9391
end
9492
9593
# Exclude from Gatekeeper quarantine on macOS Catalina+
96-
if OS.mac? && MacOS.version >= :catalina && /com.apple.quarantine/.match?(Utils.safe_popen_read("xattr", "#{bin}/{{ .Bin }}"))
94+
quarantine_check = Utils.safe_popen_read("xattr", bin/"{{ .Bin }}")
95+
if OS.mac? && MacOS.version >= :catalina && /com.apple.quarantine/.match?(quarantine_check)
9796
(bin/"{{ .Bin }}").chmod 0755
9897
begin
9998
system "xattr", "-d",
@@ -117,11 +116,11 @@ class {{ .Formula }} < Formula
117116
end
118117
119118
test do
120-
assert_predicate bin/"{{ .Bin }}", :exist?
119+
assert_path_exists bin/"{{ .Bin }}"
121120
assert_match version.to_s, shell_output("#{bin}/{{ .Bin }} version")
122121
end
123122
end
124-
`)
123+
`
125124

126125
type formulaModel struct {
127126
Repository string

0 commit comments

Comments
 (0)