Permalink
Browse files

Spike out CLT automation for mavericks

1 parent dd4e2d6 commit b26abd0d681129eba0b5f46ed43110d873d8fdc2 @wfarr wfarr committed Oct 30, 2013
Showing with 20 additions and 5 deletions.
  1. +20 −5 app/views/splash/script.sh.erb
@@ -7,18 +7,19 @@ if [ "$0" = "/tmp/install-boxen" ]; then
fi
set +e
-OSX_VERSION_CHECK=`sw_vers | grep ProductVersion | cut -f 2 -d ':' | egrep '10\.8|10\.9'`
+OSX_VERSION=`sw_vers | grep ProductVersion | cut -f 2 -d ':' | awk ' { print $1; } '`
-if [ $? != 0 ]; then
+if ! $(echo $OSX_VERSION | egrep '10\.8|10\.9'); then
echo 'You must be on Mountain Lion or greater!'
exit 1
fi
set -e
-if [ ! -f /usr/bin/gcc ]; then
+if [ "$OSX_VERSION" = "10.8" ] && [ ! -f /usr/bin/gcc ]; then
printf "%s\n" $'
-You need to have Xcode with Command Line Tools installed before you can
-continue.
+
+Since you are running OS X 10.8, you will need to install Xcode and the
+Command Line Tools to continue.
1. Go to the App Store and install Xcode.
2. Start Xcode.
@@ -29,6 +30,20 @@ continue.
exit 1
fi
+if [ "$OSX_VERSION" = "10.9" ]; then
+ printf "%s\n" $'
+
+Since you are running OS X 10.9, you will need to install the Command
+Line Tools.
+
+ 1. You should see a pop-up asking you to install them in a moment.
+ 2. Click Install!'
+
+ until $(gcc -v); do
+ sleep 60
+ done
+fi
+
# show the banner and wait for a response
printf "%s" $'\e[1;32m
######## ####### ## ## ######## ## ##

3 comments on commit b26abd0

@StefanScherer

I found this commit today as I am trying to automate the CLT installation as well.
Good approach with the loop, so it is semi-automated with GUI interaction.
But I wanted to have a vagrant up compatible way without GUI and I searched further.
I finally found this gist: https://gist.github.com/trinitronx/6217746 which at least loads the October 2013 version, but also seems to work for older Mac OS X versions.
My current solution that works for me downloading the April 2014 version is here: StefanScherer/mac-dev-box@3712244

@henry74

I'm not getting a pop-up and the terminal just keeps looping since it doesn't find the directory exists.

@seal-ss

In the meantime I have found an even better solution, I think. Here in the box-cutter/osx-vm repo there is a script xcode-cli-tools.sh that uses the softwareupdate tool on Mavericks and the hdiutil trick on older Mac OS X versions.

Please sign in to comment.