JAL-3247 Script to automatically install Jalview from the .dmg to /Applications
authorBen Soares <bsoares@dundee.ac.uk>
Tue, 7 May 2019 21:49:38 +0000 (22:49 +0100)
committerBen Soares <bsoares@dundee.ac.uk>
Tue, 7 May 2019 21:49:38 +0000 (22:49 +0100)
utils/dev_macos_install.sh [new file with mode: 0755]

diff --git a/utils/dev_macos_install.sh b/utils/dev_macos_install.sh
new file mode 100755 (executable)
index 0000000..c9e219f
--- /dev/null
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+
+# perform a dev build and install on local macOS machine
+INSTALLERVOL="Jalview Installer"
+APP=Jalview.app
+
+APPLICATIONS=/Applications
+CHANNEL=NOCHANNEL
+DMG=build/install4j/11/Jalview-OFFLINE_macos-app_DEVELOPMENT-j11.dmg
+
+gradle installers -Pgetdown_channel_name=NOCHANNEL -Pinstall4jMediaTypes=macosArchive
+
+if [ $? = 0 ]; then
+  umount "/Volumes/$INSTALLERVOL"
+  if [ -e "$DMG" ]; then
+    open $DMG
+  else
+    echo "No DMG file '$DMG'" 1>&2
+    exit 1
+  fi
+  echo "Mounting '$DMG' at /Volumes"
+  while [ \! -e "/Volumes/$INSTALLERVOL/$APP" ]; do
+    echo -n "."
+  done
+  echo ""
+fi
+if [ -e "/Volumes/$INSTALLERVOL/$APP" ]; then
+  /bin/rm -r "$APPLICATIONS/$APP"
+  rsync -avh "/Volumes/$INSTALLERVOL/$APP" "$APPLICATIONS/"
+  umount "/Volumes/$INSTALLERVOL"
+fi