Merge branch 'develop' into releases/Release_2_11_2_Branch
[jalview.git] / utils / dev_macos_install.sh
1 #!/usr/bin/env bash
2
3 # perform a dev build and install on local macOS machine
4 INSTALLERVOL="Jalview Non-Release Installer"
5 APP="Jalview Local.app"
6
7 APPLICATIONS=/Applications
8 CHANNEL=NOCHANNEL
9 DMG=build/install4j/11/Jalview_Local-TEST-macos-java_11.dmg
10
11
12 if [ x$1 != "xnogradle" ]; then
13   gradle installers -PCHANNEL=LOCAL -Pinstall4j_media_types=macosArchive
14 else
15   echo "Not running gradle installers"
16 fi
17
18 if [ $? = 0 ]; then
19   umount "/Volumes/$INSTALLERVOL"
20   if [ -e "$DMG" ]; then
21     open $DMG
22   else
23     echo "No DMG file '$DMG'" 1>&2
24     exit 1
25   fi
26   echo "Mounting '$DMG' at /Volumes"
27   N=0
28   while [ \! -e "/Volumes/$INSTALLERVOL/$APP" ]; do
29     if [ $(( N%1000 )) = 0 ]; then
30       echo -n "."
31     fi
32     N=$(( N+1 ))
33   done
34   echo ""
35 fi
36 if [ -e "/Volumes/$INSTALLERVOL/$APP" ]; then
37   echo "Removing '$APPLICATIONS/$APP'"
38   /bin/rm -r "$APPLICATIONS/$APP"
39   echo "Syncing '/Volumes/$INSTALLERVOL/$APP' to '$APPLICATIONS/'"
40   rsync -avh "/Volumes/$INSTALLERVOL/$APP" "$APPLICATIONS/"
41   echo "Unmounting '/Volumes/$INSTALLERVOL'"
42   umount "/Volumes/$INSTALLERVOL"
43 fi