Created
February 19, 2022 02:11
-
-
Save dardo82/1a68666175e84ebfb3d03fc4b75a3609 to your computer and use it in GitHub Desktop.
XCode install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
URL="https://www.xcodereleases.com/data.json" | |
SWV="$(sw_vers | awk '/1[0-9]\./{print $2}')" | |
JQF=".[] | select(.sdks.macOS[]?.number \ | |
| test(\$swv)) | .version.number, halt" | |
xcodes install $(curl --location -k -v $URL \ | |
| jq --arg swv ${SWV%.*} "$JQF" | tr -d \") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment