Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
PatTheMav committed Aug 3, 2023
1 parent 1175343 commit 368af08
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions .github/scripts/utils.zsh/create_diskimage
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ if (( _loglevel < 1 )) _hdiutil_flags='-quiet'
trap "hdiutil detach ${_hdiutil_flags} /Volumes/${output_name}; rm temp.dmg; log_group; return 2" ERR

hdiutil create ${_hdiutil_flags} \
-volname "${volume_name}" \
-srcfolder ${source} \
-ov \
-fs APFS \
-format UDRW \
temp.dmg
-volname "${volume_name}" \
-srcfolder ${source} \
-ov \
-fs APFS \
-format UDRW \
temp.dmg
hdiutil attach ${_hdiutil_flags} \
-noverify \
-readwrite \
-mountpoint /Volumes/${output_name} \
temp.dmg
-noverify \
-readwrite \
-mountpoint /Volumes/${output_name} \
temp.dmg

log_info "Waiting 2 seconds to ensure mounted volume is available..."
sleep 2
Expand All @@ -49,30 +49,30 @@ rm -rf -- /Volumes/${output_name}/.fseventsd(N)
log_info "Converting disk image..."

if (( ${+CI} )) {
local _status=0
for i ({1..5}) {
hdiutil detach ${_hdiutil_flags} /Volumes/${output_name} && _status=0 || _status=1

if (( status )) {
log_warning "Unable to eject disk image (attempt #${i}). Retrying."
} else {
break
}
local _status=0
for i ({1..5}) {
hdiutil detach ${_hdiutil_flags} /Volumes/${output_name}_bla && _status=0 || _status=1

if (( _status )) {
log_warning "Unable to eject disk image (attempt #${i}). Retrying."
} else {
break
}
}

if (( status )) {
log_error "Unable to eject disk image after 5 attempts. Aborting"
log_group
return 2
}
if (( _status )) {
log_error "Unable to eject disk image after 5 attempts. Aborting"
log_group
return 2
}
} else {
hdiutil detach ${_hdiutil_flags} /Volumes/${output_name}
hdiutil detach ${_hdiutil_flags} /Volumes/${output_name}
}

hdiutil convert ${_hdiutil_flags} \
-format ULMO \
-ov \
-o ${output_name}.dmg temp.dmg
-format ULMO \
-ov \
-o ${output_name}.dmg temp.dmg

rm temp.dmg

Expand Down

0 comments on commit 368af08

Please sign in to comment.