From b08ec5361068e65ccee7a99b7b50279a8a6447b7 Mon Sep 17 00:00:00 2001 From: Sam Bishop Date: Thu, 28 Dec 2023 17:17:23 -0800 Subject: [PATCH 1/2] Use write_exec_script --- Casks/g/godot-mono.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Casks/g/godot-mono.rb b/Casks/g/godot-mono.rb index 06d7dab002..c8bc7c5ff8 100644 --- a/Casks/g/godot-mono.rb +++ b/Casks/g/godot-mono.rb @@ -18,7 +18,8 @@ cask "godot-mono" do depends_on macos: ">= :sierra" app "Godot_mono.app" - binary "#{appdir}/Godot_mono.app/Contents/MacOS/Godot", target: "godot-mono" + + bin.write_exec_script "#{appdir}/Godot_mono.app/Contents/MacOS/Godot", target: "godot-mono" uninstall quit: "org.godotengine.godot" From 70ff0e2d27aefed282700563aef261c022e62f1c Mon Sep 17 00:00:00 2001 From: Sam Bishop Date: Sat, 30 Dec 2023 13:29:55 -0800 Subject: [PATCH 2/2] Add shim script --- Casks/g/godot-mono.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Casks/g/godot-mono.rb b/Casks/g/godot-mono.rb index c8bc7c5ff8..bf602e328f 100644 --- a/Casks/g/godot-mono.rb +++ b/Casks/g/godot-mono.rb @@ -18,8 +18,16 @@ cask "godot-mono" do depends_on macos: ">= :sierra" app "Godot_mono.app" + # shim script (https://github.com/Homebrew/homebrew-cask/issues/18809) + shimscript = "#{staged_path}/godot-mono.wrapper.sh" + binary shimscript, target: "godot-mono" - bin.write_exec_script "#{appdir}/Godot_mono.app/Contents/MacOS/Godot", target: "godot-mono" + preflight do + File.write shimscript, <<~EOS + #!/bin/bash + '#{appdir}/Godot_mono.app/Contents/MacOS/Godot' "$@" + EOS + end uninstall quit: "org.godotengine.godot"