diff --git a/images/macos/provision/core/chrome.sh b/images/macos/provision/core/chrome.sh index 4a9deba1..332a11d1 100644 --- a/images/macos/provision/core/chrome.sh +++ b/images/macos/provision/core/chrome.sh @@ -1,7 +1,8 @@ #!/bin/bash -e -o pipefail +source ~/utils/utils.sh echo "Installing Chrome..." -brew cask install google-chrome +brew_cask_install_ignoring_sha256 "google-chrome" echo "Installing Chrome Driver" brew cask install chromedriver diff --git a/images/macos/provision/utils/utils.sh b/images/macos/provision/utils/utils.sh index d2c39317..c43f4efe 100755 --- a/images/macos/provision/utils/utils.sh +++ b/images/macos/provision/utils/utils.sh @@ -107,4 +107,17 @@ get_default_xcode_from_toolset() { verlte() { sortedVersion=$(echo -e "$1\n$2" | sort -V | head -n1) [ "$1" = "$sortedVersion" ] +} + +brew_cask_install_ignoring_sha256() { + local TOOL_NAME=$1 + + CASK_DIR="$(brew --repo homebrew/cask)/Casks" + chmod a+w "$CASK_DIR/$TOOL_NAME.rb" + SHA=$(grep "sha256" "$CASK_DIR/$TOOL_NAME.rb" | awk '{print $2}') + sed -i '' "s/$SHA/:no_check/" "$CASK_DIR/$TOOL_NAME.rb" + brew cask install $TOOL_NAME + pushd $CASK_DIR + git checkout HEAD -- "$TOOL_NAME.rb" + popd } \ No newline at end of file