Use Shim Script to replace the default binary link (#95315)

* Use Shim Script to replace the default binary link

* update upic from v0.21.0 to v0.21.1
This commit is contained in:
Svend 2020-12-13 09:20:02 +08:00 committed by GitHub
parent 20633c5900
commit 55ddfa70c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,6 @@
cask "upic" do
version "0.21.0"
sha256 "6957497e865b7ecba634ddbba77001f0881fbe7402c1381a470e0f201bdb677c"
version "0.21.1"
sha256 "1152e2f3995cc33d16d764348618a70a9fb067f2b17f548a813646809aa1154c"
url "https://github.com/gee1k/uPic/releases/download/v#{version}/uPic.zip"
appcast "https://github.com/gee1k/uPic/releases.atom"
@ -11,7 +11,15 @@ cask "upic" do
depends_on macos: ">= :sierra"
app "uPic.app"
binary "#{appdir}/uPic.app/Contents/MacOS/uPic", target: "upic"
shimscript = "#{staged_path}/upic.wrapper.sh"
binary shimscript, target: "upic"
preflight do
IO.write shimscript, <<~EOS
#!/bin/bash
'#{appdir}/uPic.app/Contents/MacOS/uPic' "$@"
EOS
end
zap trash: [
"~/Library/Preferences/com.svend.uPic.plist",