LinusU / node-appdmg

💾 Generate your app dmgs
MIT License
1.67k stars 151 forks source link

`temporaryImagePath` could disappear before disk is unmounted #228

Open osy opened 1 year ago

osy commented 1 year ago

hdiutil detach does two things: 1. it will unmount the volume from /Volumes and 2. it will detach the disk image. Currently, appdmg will retry calling hdiutil detach when it fails. However, if it fails due to 2, then /Volumes/NAME as specified in temporaryImagePath will be gone. Then subsequent retries will fail as well. We are observing this happening on a slow filesystem where the writes are being flushed but the volume was able to be unmounted.

Suggestion: Use diskutil info /Volumes/NAME to get the Device Node and use the node name for hdiutil detach.