Skip to content

Instantly share code, notes, and snippets.

@lasote
Last active October 3, 2019 10:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lasote/b0f4e8b0de7777f01aeddb6ffae5670c to your computer and use it in GitHub Desktop.
Save lasote/b0f4e8b0de7777f01aeddb6ffae5670c to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "Xcode CLI tools not found. Installing them..."
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress;
PROD=$(softwareupdate -l |
grep "\*.*Command Line" |
head -n 1 | awk -F"*" '{print $2}' |
sed -e 's/^ *//' |
tr -d '\n')
echo "Command: $PROD"
softwareupdate -i "$PROD";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment