aboutsummaryrefslogtreecommitdiffstats
path: root/coin/provisioning/common/macos/install-commandlinetools.sh
diff options
context:
space:
mode:
Diffstat (limited to 'coin/provisioning/common/macos/install-commandlinetools.sh')
-rwxr-xr-xcoin/provisioning/common/macos/install-commandlinetools.sh56
1 files changed, 15 insertions, 41 deletions
diff --git a/coin/provisioning/common/macos/install-commandlinetools.sh b/coin/provisioning/common/macos/install-commandlinetools.sh
index d57e1d2f..18ff1036 100755
--- a/coin/provisioning/common/macos/install-commandlinetools.sh
+++ b/coin/provisioning/common/macos/install-commandlinetools.sh
@@ -33,56 +33,30 @@
##
#############################################################################
source "${BASH_SOURCE%/*}/../unix/DownloadURL.sh"
-source "${BASH_SOURCE%/*}/../unix/try_catch.sh"
set -ex
# Command line tools is need by homebrew
function InstallCommandLineTools {
-
- ExceptionMount=101
- ExceptionInstall=102
- ExceptionUnmount=103
-
url=$1
url_alt=$2
expectedSha1=$3
packageName=$4
version=$5
- try
- (
- DownloadURL $url $url_alt $expectedSha1 /tmp/$packageName
- echo "Mounting $packageName"
- hdiutil attach /tmp/$packageName || throw $ExceptionMount
- cd "/Volumes/Command Line Developer Tools"
- echo "Installing"
- sudo installer -verbose -pkg *.pkg -target / || throw $ExceptionInstall
- cd /
- # Let's fait for 5 second before unmounting. Sometimes resource is busy and cant be unmounted
- sleep 3
- echo "Unmounting"
- umount /Volumes/Command\ Line\ Developer\ Tools/ || throw $ExceptionUnmount
- echo "Removing $packageName"
- rm /tmp/$packageName
-
- echo "Command Line Tools = $version" >> ~/versions.txt
- )
- catch || {
- case $ex_code in
- $ExceptionMount)
- echo "Failed to mount"
- exit 1;
- ;;
- $ExceptionInstall)
- echo "Failed to install"
- exit 1;
- ;;
- $ExceptionUnmount)
- echo "Failed to unmount"
- exit 1;
-
- esac
- }
-
+ DownloadURL $url $url_alt $expectedSha1 /tmp/$packageName
+ echo "Mounting $packageName"
+ hdiutil attach /tmp/$packageName
+ cd "/Volumes/Command Line Developer Tools"
+ echo "Installing"
+ sudo installer -verbose -pkg *.pkg -target /
+ cd /
+ # Let's fait for 5 second before unmounting. Sometimes resource is busy and cant be unmounted
+ sleep 3
+ echo "Unmounting"
+ umount /Volumes/Command\ Line\ Developer\ Tools/
+ echo "Removing $packageName"
+ rm /tmp/$packageName
+
+ echo "Command Line Tools = $version" >> ~/versions.txt
}