diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index cad1373..a5fcf0b 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -86,13 +86,13 @@ checkForDependencies() { comm=$1 fi - commOuput=$(command -v ${comm} &> /dev/null) + command -v ${comm} &> /dev/null if [ $? -eq 1 ]; then unameOutput=$(uname -a | grep "arch") if [ -f "/etc/arch-release" ] || [ $unameOutput -eq 0 ]; then sudo pacman --noconfirm --needed -Sy ${1} > /dev/null 2>&1 if [ $? -eq 1 ]; then - echo "You must have an active internet connection." >&2 + echo "Couldn't install ${1}." >&2 exit 1 fi @@ -114,11 +114,11 @@ startRice() { runScript() { lastFolder=$(pwd -P) - cocoRiceFolder=$(echo "$(pwd -P)" | awk '{ sub(/CocoRice.*/, "CocoRice"); print }') + cocoRiceFolder=$(pwd -P | awk '{ sub(/CocoRice.*/, "CocoRice"); print }') cd $cocoRiceFolder source scripts/common.sh - checkParameters $@ + checkParameters "$@" checkForDependencies startRice @@ -127,4 +127,4 @@ runScript() { cd $lastFolder } -runScript $@ +runScript "$@" diff --git a/scripts/common.sh b/scripts/common.sh index eecc93c..8966fbd 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -28,7 +28,7 @@ useDialog() { if [ "$str" = "VALUES" ]; then argc="$#"; i=1 for item in "$@"; do - if [ $i -eq $((${argc}-1)) ]; then + if [ $i -eq $((argc-1)) ]; then str="$item" break fi @@ -39,8 +39,8 @@ useDialog() { width=$(calcWidthDialog "$str") height=$(calcHeightDialog "$str") if [ $inputbox = true ]; then - width=$((${width}+15)) - height=$((${height}+2)) + width=$((width+15)) + height=$((height+2)) fi formatOptions "$@" if [ $found = false ]; then @@ -55,7 +55,7 @@ useWhiptail() { if [ "$str" = "VALUES" ]; then argc="$#"; i=1 for item in "$@"; do - if [ $i -eq $((${argc}-1)) ]; then + if [ $i -eq $((argc-1)) ]; then str="$item" break fi @@ -67,7 +67,7 @@ useWhiptail() { width=$(calcWidthWhiptail "$str") height=$(calcHeightWhiptail "$str") if [ $inputbox = true ]; then - width=$((${width}+15)) + width=$((width+15)) fi if [ $infobox = true ]; then height=$((height-1)) @@ -109,7 +109,7 @@ useDialogMenu() { calcWidthWhiptail() { width=$(echo "$1" | wc -c) - echo $((${width}+8)) + echo $((width+8)) } calcWidthDialog() { @@ -126,7 +126,7 @@ calcWidthDialog() { done if [ $found = false ]; then - echo $(($count+8)) + echo $((count+8)) else echo $option fi @@ -139,7 +139,7 @@ calcHeightWhiptail() { x = (($1 - $2 + ($2 * 60)) / 60) printf "%d", (x == int(x)) ? x : int(x) + 1 }') - echo $((6+${height})) + echo $((6+height)) } calcHeightDialog() { @@ -149,7 +149,7 @@ calcHeightDialog() { x = (($1 - $2 + ($2 * 60)) / 60) printf "%d", (x == int(x)) ? x : int(x) + 1 }') - echo $((4+${height})) + echo $((4+height)) } setDialogBox() { diff --git a/scripts/install.sh b/scripts/install.sh index 6efc6f1..01f2be7 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -3,7 +3,7 @@ cloneAndMake() { displayDialogBox --infobox "Downloading ${1}" VALUES git clone $2 > /dev/null 2>&1 - cd $1; sudo make install > /dev/null 2>&1; cd .. + (cd $1; sudo make install > /dev/null 2>&1) } downloadAndInstallPackages() { diff --git a/scripts/linkFiles.sh b/scripts/linkFiles.sh index 504399a..1d24bcf 100755 --- a/scripts/linkFiles.sh +++ b/scripts/linkFiles.sh @@ -88,7 +88,7 @@ loopThroughFiles() { displayDialogBox --yesno "There are 'other' files, would you like to install them?\n\n${files}" || return fi - sudo bash -c "$(declare -f runDetachedScript); $(declare -f linkFile); "runDetachedScript" "$dialogBox"" + sudo bash -c "$(declare -f runDetachedScript); $(declare -f linkFile); runDetachedScript $dialogBox" } runDetachedScript() {