Skip to content

Commit

Permalink
Update install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
woensug-choi authored Sep 16, 2024
1 parent 5b37b18 commit ece99af
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -199,25 +199,10 @@ fi

# Check if the Xcode path is correct
if [ "$(xcode-select -p)" != "/Applications/Xcode.app/Contents/Developer" ]; then
# Check if the Xcode license has been accepted
if [ "$XCODE_VERSION" != "$ACCEPTED_LICENSE_VERSION" ]; then
echo -e "\033[33m⚠️ WARNING: Xcode license needs to be accepted. Please follow the prompts to accept the license.\033[0m"
sudo xcodebuild -license accept
# shellcheck disable=SC2181
if [ $? -ne 0 ]; then
echo -e "\033[31m❌ Error: Failed to accept Xcode license. Please try again.\033[0m"
exit 1
fi
fi
echo -e "\033[34m> Changing the Xcode path...\033[0m"
echo -e "\033[34m>=========\033[0m"
sudo xcode-select -s "/Applications/Xcode.app/Contents/Developer"
XCODE_VERSION=$(xcodebuild -version | grep '^Xcode\s' | sed -E 's/^Xcode[[:space:]]+([0-9\.]+)/\1/')
ACCEPTED_LICENSE_VERSION=$(defaults read /Library/Preferences/com.apple.dt.Xcode 2> /dev/null | grep IDEXcodeVersionForAgreedToGMLicense | cut -d '"' -f 2)
echo -e "\033[34m>=========\033[0m"
sudo xcodebuild -license accept
echo -e "\033[34m>$XCODE_VERSION\033[0m"
echo -e "\033[34m>$ACCEPTED_LICENSE_VERSION\033[0m"
fi

# Check Brew installation
Expand Down

0 comments on commit ece99af

Please sign in to comment.