diff --git a/images/macos/provision/utils/utils.sh b/images/macos/provision/utils/utils.sh index 1bca5c8a..7f295897 100755 --- a/images/macos/provision/utils/utils.sh +++ b/images/macos/provision/utils/utils.sh @@ -98,13 +98,14 @@ verlte() { [ "$1" = "$sortedVersion" ] } -brew_install_ignoring_sha256() { +brew_cask_install_ignoring_sha256() { local TOOL_NAME=$1 - CASK_DIR=/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask/Casks + 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 - sed -i '' "s/:no_check/:$SHA/" "$CASK_DIR/$TOOL_NAME.rb" + cd $CASK_DIR + git reset --hard } \ No newline at end of file