#!/bin/bash echo '#!/bin/bash' >> brew-install.sh echo ' installCLT() { echo -e "/n Installing Command Line Tools (CLT) for Xcode" sudo xcode-select --install }' >> brew-install.sh echo ' installHomebrew() { echo -e "/n Installing Homebrew" #/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" #sudo chown -R $USER /usr/local/ #export $PATH=/usr/local/bin:$PATH brew update }' >> brew-install.sh #if type xcode-select >&- && xpath=$( xcode-select --print-path ) && # test -d "${xpath}" && test -x "${xpath}" ; then # #... is correctly installed #else # #... isn't correctly installed #fi echo ' clt=$(xcode-select --install 2>&1 | grep installed) if [ -n "$clt" ]; then echo "Command Line Tools (CLT) for Xcode already installed"; else echo "Installing Command Line Tools (CLT) for Xcode"; fi' >> brew-install.sh echo ' if [[ $(command -v brew) == "" ]]; then installHomebrew else echo "Updating Homebrew" brew update fi' >> brew-install.sh chmod +x brew-install.sh