@@ -59,6 +59,8 @@ function usage() {
5959 echo " execute hdiutil in verbose mode"
6060 echo " --hdiutil-quiet"
6161 echo " execute hdiutil in quiet mode"
62+ echo " --bless"
63+ echo " bless the mount folder (deprecated, needs macOS 12.2.1 or older)"
6264 echo " --sandbox-safe"
6365 echo " execute hdiutil with sandbox compatibility, do not bless and do not execute the cosmetic AppleScript"
6466 echo " --version show tool version number"
@@ -78,6 +80,7 @@ ADD_FILE_TARGETS=()
7880IMAGEKEY=" "
7981HDIUTIL_VERBOSITY=" "
8082SANDBOX_SAFE=0
83+ BLESS=0
8184SKIP_JENKINS=0
8285MAXIMUM_UNMOUNTING_ATTEMPTS=3
8386POSITION_CLAUSE=" "
@@ -161,6 +164,9 @@ while [[ "${1:0:1}" = "-" ]]; do
161164 --sandbox-safe)
162165 SANDBOX_SAFE=1
163166 shift ;;
167+ --bless)
168+ BLESS=1
169+ shift ;;
164170 --skip-jenkins)
165171 SKIP_JENKINS=1
166172 shift ;;
@@ -285,14 +291,14 @@ MOUNT_DIR="/Volumes/${VOLUME_NAME}"
285291# Unmount leftover dmg if it was mounted previously (e.g. developer mounted dmg, installed app and forgot to unmount it)
286292if [[ -d " ${MOUNT_DIR} " ]]; then
287293 echo " Unmounting previously mounted disk image..."
288- DEV_NAME=$( hdiutil info | egrep --color=never ' ^/dev/' | sed 1q | awk ' {print $1}' )
294+ DEV_NAME=$( hdiutil info | grep -E --color=never ' ^/dev/' | sed 1q | awk ' {print $1}' )
289295 hdiutil detach " ${DEV_NAME} "
290296fi
291297
292298echo " Mounting disk image..."
293299
294300echo " Mount directory: $MOUNT_DIR "
295- DEV_NAME=$( hdiutil attach -readwrite -noverify -noautoopen " ${DMG_TEMP_NAME} " | egrep --color=never ' ^/dev/' | sed 1q | awk ' {print $1}' )
301+ DEV_NAME=$( hdiutil attach -readwrite -noverify -noautoopen " ${DMG_TEMP_NAME} " | grep -E --color=never ' ^/dev/' | sed 1q | awk ' {print $1}' )
296302echo " Device name: $DEV_NAME "
297303
298304if [[ -n " $BACKGROUND_FILE " ]]; then
@@ -374,7 +380,7 @@ chmod -Rf go-w "${MOUNT_DIR}" &> /dev/null || true
374380echo " Done fixing permissions."
375381
376382# make the top window open itself on mount:
377- if [[ $SANDBOX_SAFE -eq 0 ]]; then
383+ if [[ $BLESS -eq 1 && $ SANDBOX_SAFE -eq 0 ]]; then
378384 echo " Blessing started"
379385 bless --folder " ${MOUNT_DIR} " --openfolder " ${MOUNT_DIR} "
380386 echo " Blessing finished"
0 commit comments