Skip to content

Commit 7d2183b

Browse files
authored
Fix cog cask postflight xattr path to use actual binary name (#32)
The postflight block referenced staged_path/cog, but the downloaded binary retains its original name (cog_Darwin_arm64 or cog_Darwin_x86_64) in the staged directory. The binary stanza only creates a symlink with the target name, it does not rename the source file. This caused 'xattr -dr com.apple.quarantine' to fail with 'No such file' on every install.
1 parent 5217f80 commit 7d2183b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Casks/cog.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
end}", target: "cog"
2727

2828
postflight do
29+
binary_name = "cog_Darwin_#{Hardware::CPU.arm? ? "arm64" : "x86_64"}"
2930
system_command "/usr/bin/xattr",
30-
args: ["-dr", "com.apple.quarantine", "#{staged_path}/cog"]
31+
args: ["-dr", "com.apple.quarantine", "#{staged_path}/#{binary_name}"]
3132
end
3233
end

0 commit comments

Comments
 (0)