sindresorhus / create-dmg

Create a good-looking DMG for your macOS app in seconds
MIT License
4.72k stars 196 forks source link

Fetching the resulting dmg name #65

Closed attisan closed 2 years ago

attisan commented 3 years ago

I'm having a difficult time fetching the resulting DMGs name from within an bash script. Is it me, or is the nature of the updated output part of the problem?

sindresorhus commented 3 years ago

It's outputted on stderr.

JosephTLyons commented 1 year ago

How can I grab the resulting dmg name if I don't want to code sign with this tool? It seems like if I don't code sign, an error relating to code signing is emitted and I can't get the resulting dmg file name.

{
    IFS=$'\n' read -r -d '' CAPTURED_STDERR;
    IFS=$'\n' read -r -d '' CAPTURED_STDOUT;
} < <((printf '\0%s\0' "$(create-dmg --overwrite --identity="temp" /Applications/Zed.app/ ~/Desktop/ || [ $? -eq 2 ])" 1>&2) 2>&1)

echo $CAPTURED_STDERR
- Creating DMG
ℹ Minimum runtime 10.15.7 detected, using ULFO format
- Creating icon
✖ Code signing failed. The DMG is fine, just not code signed.
No suitable code signing identity found

echo $CAPTURED_STDOUT
(nothing here)