From 3c837bc8e9c5159c919a8753041ee07f014c4436 Mon Sep 17 00:00:00 2001 From: Nathaniel Landau Date: Sun, 28 Jun 2015 22:49:23 -0400 Subject: [PATCH] Fixed IFS handling. Added messaging --- lib/sharedFunctions.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/sharedFunctions.sh b/lib/sharedFunctions.sh index 2a7b567..f0ab2d1 100755 --- a/lib/sharedFunctions.sh +++ b/lib/sharedFunctions.sh @@ -336,19 +336,24 @@ function help () { # ----------------------------------- function checkDependencies() { - if [ -n "$homebrewDependencies" ]; then + saveIFS=$IFS + IFS=$' \n\t' + if [ -n "${homebrewDependencies}" ]; then + warning "You are missing dependencies. We will now install them." + LISTINSTALLED="brew list" INSTALLCOMMAND="brew install" - RECIPES="${homebrewDependencies}" + RECIPES=("${homebrewDependencies[@]}") # Invoke functions from setupScriptFunctions.sh hasHomebrew doInstall fi if [ -n "$caskDependencies" ]; then + warning "You are missing dependencies. We will now install them." LISTINSTALLED="brew cask list" INSTALLCOMMAND="brew cask install --appdir=/Applications" - RECIPES="${caskDependencies}" + RECIPES=("${caskDependencies[@]}") # Invoke functions from setupScriptFunctions.sh hasHomebrew @@ -356,12 +361,14 @@ function checkDependencies() { doInstall fi if [ -n "$gemDependencies" ]; then + warning "You are missing dependencies. We will now install them." LISTINSTALLED="gem list | awk '{print $1}'" INSTALLCOMMAND="gem install" - RECIPES="${gemDependencies}" + RECIPES=("${gemDependencies[@]}") # Invoke functions from setupScriptFunctions.sh doInstall fi + IFS=$saveIFS } # pauseScript