Files
runner-images-sangeeth/images/macos/provision/core/vsmac.sh
T

30 lines
917 B
Bash
Raw Normal View History

#!/bin/bash -e -o pipefail
2020-09-10 14:34:08 +03:00
source ~/utils/utils.sh
source ~/utils/xamarin-utils.sh
VSMAC_VERSION=$(get_toolset_value '.xamarin.vsmac')
2020-09-24 01:44:29 +07:00
if [ $VSMAC_VERSION == "latest" ]; then
VSMAC_VERSION=$(curl https://formulae.brew.sh/api/cask/visual-studio.json 2>/dev/null | jq .version | tr -d \")
2020-09-22 15:31:29 +07:00
fi
2020-09-10 14:34:08 +03:00
VSMAC_DOWNLOAD_URL=$(buildVSMacDownloadUrl $VSMAC_VERSION)
TMPMOUNT=`/usr/bin/mktemp -d /tmp/visualstudio.XXXX`
TMPMOUNT_DOWNLOADS="$TMPMOUNT/downloads"
mkdir $TMPMOUNT_DOWNLOADS
download_with_retries $VSMAC_DOWNLOAD_URL $TMPMOUNT_DOWNLOADS
echo "Mounting Visual studio..."
VISUAL_STUDIO_NAME=${VSMAC_DOWNLOAD_URL##*/}
hdiutil attach "$TMPMOUNT_DOWNLOADS/$VISUAL_STUDIO_NAME" -mountpoint "$TMPMOUNT"
echo "Moving Visual Studio to /Applications/..."
pushd $TMPMOUNT
tar cf - "./Visual Studio.app" | tar xf - -C /Applications/
popd
sudo hdiutil detach "$TMPMOUNT"
sudo rm -rf "$TMPMOUNT"
invoke_tests "Common" "VSMac"