Skip to content

Commit 5fdfa1b

Browse files
committed
fix(brew): raise on unsupported CPU architecture in Homebrew formula
Without an else branch in the CPU conditionals, the formula would proceed with no url set on unsupported architectures (e.g. 32-bit Linux), giving a confusing install failure rather than a clear error message.
1 parent 5bb82b5 commit 5fdfa1b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.craft.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ targets:
3636
elsif Hardware::CPU.intel?
3737
url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-darwin-x64"
3838
sha256 "{{checksums.sentry-darwin-x64}}"
39+
else
40+
raise "Unsupported macOS CPU architecture: #{Hardware::CPU.type}"
3941
end
4042
elsif OS.linux?
4143
if Hardware::CPU.arm? && Hardware::CPU.is_64_bit?
@@ -44,6 +46,8 @@ targets:
4446
elsif Hardware::CPU.intel? && Hardware::CPU.is_64_bit?
4547
url "https://github.com/getsentry/cli/releases/download/{{version}}/sentry-linux-x64"
4648
sha256 "{{checksums.sentry-linux-x64}}"
49+
else
50+
raise "Unsupported Linux CPU architecture: #{Hardware::CPU.type} (only 64-bit arm and x86_64 are supported)"
4751
end
4852
else
4953
raise "Unsupported operating system"

0 commit comments

Comments
 (0)