Tweaks to brew and setup scripts.

This commit is contained in:
Ivan Malison 2014-08-25 20:31:11 -07:00
parent 09b6202d18
commit 3e6dc3a041
3 changed files with 26 additions and 6 deletions

View File

@ -1,3 +1,14 @@
function get_brew() {
hash make &>/dev/null
if [ $? -ne 0 ]
then
echo "Make not found. Please install xcode developer tools."
return -1
fi
hash brew &>/dev/null && echo "Homebrew found!" || ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew update
}
function brew_install_items() { function brew_install_items() {
for package_install_string in $@; for package_install_string in $@;
do do

View File

@ -63,23 +63,30 @@ function setup_help() {
-h display this help message." -h display this help message."
} }
function get_command_line_tools() {
hash gcc 2> /dev/null || xcode-select --install
}
function setup() { function setup() {
if [[ $# -eq 0 ]] ; then if [[ $# -eq 0 ]] ; then
setup_help setup_help
exit 0 exit 0
fi fi
while getopts "aosbpev" OPTCHAR; while getopts "acosbpev" OPTCHAR;
do do
case $OPTCHAR in case $OPTCHAR in
a) a)
source resources/apt-get.sh source resources/apt-get.sh
;; ;;
b) b)
do_the_brew_help get_command_line_tools
read -p "Enter flags for brew package installation: if get_brew; then
do_the_brew_help
read -p "Enter flags for brew package installation:
" "
[[ $REPLY[0] != '-' ]] && REPLY="-$REPLY" [[ $REPLY[0] != '-' ]] && REPLY="-$REPLY"
do_the_brew $REPLY do_the_brew $REPLY
fi
;; ;;
o) o)
sudo -v sudo -v
@ -99,7 +106,8 @@ function setup() {
e) e)
case uname in case uname in
Darwin) Darwin)
do_the_brew -au get_command_line_tools
get_brew && do_the_brew -au
;; ;;
Linux) Linux)
apt-get apt-get

View File

@ -28,3 +28,4 @@ esac
git clone git@github.com:IvanMalison/dotfiles.git git clone git@github.com:IvanMalison/dotfiles.git
cd dotfiles cd dotfiles
./setup.sh -e