Merge branch 'improvement/JAL-4409_implement_extra_schemes_in_getdown' into develop
[jalview.git] / 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