File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,6 +128,20 @@ verify_dmg() {
128128 return 1
129129}
130130
131+ detach_dmg_if_attached () {
132+ local dmg=" $1 "
133+ local device
134+
135+ device=$( hdiutil info | awk -v path=" $dmg " '
136+ $0 ~ "^image-path[[:space:]]*: " path "$" { seen=1; next }
137+ seen && $1 ~ "^/dev/disk" { print $1; exit }
138+ ' ) || true
139+
140+ if [[ -n " $device " ]]; then
141+ hdiutil detach " $device " > /dev/null
142+ fi
143+ }
144+
131145detect_developer_id () {
132146 if [[ -n " ${DEV_ID_APP:- } " ]]; then
133147 return 0
@@ -330,6 +344,7 @@ rm -f "$NOTARY_ZIP"
330344echo " ==> Creating DMG"
331345rm -f " $DMG "
332346hdiutil create -volname " $DISPLAY_NAME " -srcfolder " $APP " -ov -format UDZO " $DMG "
347+ detach_dmg_if_attached " $DMG "
333348codesign --force --sign " $DEV_ID_APP " --timestamp " $DMG "
334349verify_dmg " $DMG "
335350
You can’t perform that action at this time.
0 commit comments