JAL-4409 corrected the umount of dmg to hdiutil detach to allow subsequent opening...
authorBen Soares <b.soares@dundee.ac.uk>
Fri, 17 May 2024 09:03:30 +0000 (10:03 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Fri, 17 May 2024 09:03:30 +0000 (10:03 +0100)
utils/dev_macos_install.sh

index 80cb94d..7c5fd15 100755 (executable)
@@ -104,7 +104,9 @@ else
 fi
 
 if [ $? = 0 ]; then
-  umount "/Volumes/$INSTALLERVOL"
+  if [ -e "/Volumes/$INSTALLERVOL" ]; then
+    hdiutil detach "/Volumes/$INSTALLERVOL"
+  fi
   if [ -e "$DMG" ]; then
     open $DMG
   else
@@ -116,10 +118,14 @@ if [ $? = 0 ]; then
   MOUNTEDAPP="/Volumes/$INSTALLERVOL/$APP.app"
   echo "Waiting for '$MOUNTEDAPP' to appear"
   while [ \! -e "$MOUNTEDAPP" ]; do
-    if [ $(( N%1000 )) = 0 ]; then
-      echo -n "."
-    fi
+    echo -n "."
     N=$(( N+1 ))
+    if [ $N = 40 ]; then
+      echo ""
+      echo "Looks like something wrong with the DMG '$DMG'"
+      exit 4
+    fi
+    sleep 0.1
   done
   echo ""
 else
@@ -133,5 +139,5 @@ if [ -e "$MOUNTEDAPP" ]; then
   echo "Syncing '$MOUNTEDAPP' to '$APPLICATIONS/'"
   rsync -avh "$MOUNTEDAPP" "$APPLICATIONS/"
   echo "Unmounting '/Volumes/$INSTALLERVOL'"
-  umount "/Volumes/$INSTALLERVOL"
+  hdiutil detach "/Volumes/$INSTALLERVOL"
 fi