Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Commit

Permalink
Spike out CLT automation for mavericks
Browse files Browse the repository at this point in the history
  • Loading branch information
wfarr committed Oct 30, 2013
1 parent dd4e2d6 commit b26abd0
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions app/views/splash/script.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
######## ####### ## ## ######## ## ##
Expand Down

3 comments on commit b26abd0

@StefanScherer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@seal-ss
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.