diff --git a/crypt/crypt b/crypt/crypt index 626006d..7050eea 100755 --- a/crypt/crypt +++ b/crypt/crypt @@ -40,14 +40,14 @@ update() read -r answer if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then cd ~ || { echo 'Update Failed' ; exit 1 ; } - if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Your password is required to continue with the update" ; sudo rm -r -f $repositoryName ; }; fi #sudo command only on error + if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Permissions Error: try running the update as sudo"; exit 1; } ; fi git clone "https://github.com/$githubUserName/$repositoryName" || { echo "Couldn't download latest version" ; exit 1; } cd $repositoryName || { echo 'Update Failed' ; exit 1 ;} git checkout "v$latestVersion" 2> /dev/null || git checkout "$latestVersion" 2> /dev/null || echo "Couldn't git checkout to stable release, updating to latest commit." chmod a+x install.sh #this might be necessary in your case but wasnt in mine. - ./$nameOfInstallFile "update" || { echo "Your password is required to continue with the update" ; sudo ./$nameOfInstallFile "update" ; } + ./$nameOfInstallFile "update" || { echo "Permissions Error: try running the update as sudo"; exit 1; } cd .. - rm -r -f $repositoryName || sudo rm -r -f $repositoryName #sudo command only on error + rm -r -f $repositoryName || { echo "Permissions Error: update succesfull but cannot delete temp files located at ~/$repositoryName delete this directory with sudo"; exit 1; } else exit 1 fi diff --git a/currency/currency b/currency/currency index c0e6c2c..bb55aec 100755 --- a/currency/currency +++ b/currency/currency @@ -156,14 +156,14 @@ update() read -r answer if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then cd ~ || { echo 'Update Failed' ; exit 1 ; } - if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Your password is required to continue with the update" ; sudo rm -r -f $repositoryName ; }; fi #sudo command only on error + if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Permissions Error: try running the update as sudo"; exit 1; } ; fi git clone "https://github.com/$githubUserName/$repositoryName" || { echo "Couldn't download latest version" ; exit 1; } cd $repositoryName || { echo 'Update Failed' ; exit 1 ;} git checkout "v$latestVersion" 2> /dev/null || git checkout "$latestVersion" 2> /dev/null || echo "Couldn't git checkout to stable release, updating to latest commit." chmod a+x install.sh #this might be necessary in your case but wasnt in mine. - ./$nameOfInstallFile "update" || { echo "Your password is required to continue with the update" ; sudo ./$nameOfInstallFile "update" ; } + ./$nameOfInstallFile "update" || { echo "Permissions Error: try running the update as sudo"; exit 1; } cd .. - rm -r -f $repositoryName || sudo rm -r -f $repositoryName #sudo command only on error + rm -r -f $repositoryName || { echo "Permissions Error: update succesfull but cannot delete temp files located at ~/$repositoryName delete this directory with sudo"; exit 1; } else exit 1 fi diff --git a/movies/movies b/movies/movies index d3f6048..5d29913 100755 --- a/movies/movies +++ b/movies/movies @@ -76,14 +76,14 @@ update() read -r answer if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then cd ~ || { echo 'Update Failed' ; exit 1 ; } - if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Your password is required to continue with the update" ; sudo rm -r -f $repositoryName ; }; fi #sudo command only on error + if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Permissions Error: try running the update as sudo"; exit 1; } ; fi git clone "https://github.com/$githubUserName/$repositoryName" || { echo "Couldn't download latest version" ; exit 1; } cd $repositoryName || { echo 'Update Failed' ; exit 1 ;} git checkout "v$latestVersion" 2> /dev/null || git checkout "$latestVersion" 2> /dev/null || echo "Couldn't git checkout to stable release, updating to latest commit." chmod a+x install.sh #this might be necessary in your case but wasnt in mine. - ./$nameOfInstallFile "update" || { echo "Your password is required to continue with the update" ; sudo ./$nameOfInstallFile "update" ; } + ./$nameOfInstallFile "update" || { echo "Permissions Error: try running the update as sudo"; exit 1; } cd .. - rm -r -f $repositoryName || sudo rm -f -r $repositoryName #sudo command only on error + rm -r -f $repositoryName || { echo "Permissions Error: update succesfull but cannot delete temp files located at ~/$repositoryName delete this directory with sudo"; exit 1; } else exit 1 fi diff --git a/stocks/stocks b/stocks/stocks index 2b2e43f..fd81966 100755 --- a/stocks/stocks +++ b/stocks/stocks @@ -89,14 +89,14 @@ update() read -r answer if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then cd ~ || { echo 'Update Failed' ; exit 1 ; } - if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Your password is required to continue with the update" ; sudo rm -r -f $repositoryName ; }; fi #sudo command only on error + if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Permissions Error: try running the update as sudo"; exit 1; } ; fi git clone "https://github.com/$githubUserName/$repositoryName" || { echo "Couldn't download latest version" ; exit 1; } cd $repositoryName || { echo 'Update Failed' ; exit 1 ;} git checkout "v$latestVersion" 2> /dev/null || git checkout "$latestVersion" 2> /dev/null || echo "Couldn't git checkout to stable release, updating to latest commit." chmod a+x install.sh #this might be necessary in your case but wasnt in mine. - ./$nameOfInstallFile "update" || { echo "Your password is required to continue with the update" ; sudo ./$nameOfInstallFile "update" ; } + ./$nameOfInstallFile "update" || { echo "Permissions Error: try running the update as sudo"; exit 1; } cd .. - rm -r -f $repositoryName || sudo rm -r -f $repositoryName #sudo command only on error + rm -r -f $repositoryName || { echo "Permissions Error: update succesfull but cannot delete temp files located at ~/$repositoryName delete this directory with sudo"; exit 1; } else exit 1 fi diff --git a/weather/weather b/weather/weather index 2361f41..ba4e513 100755 --- a/weather/weather +++ b/weather/weather @@ -57,14 +57,14 @@ update() read -r answer if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then cd ~ || { echo 'Update Failed' ; exit 1 ; } - if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Your password is required to continue with the update" ; sudo rm -r -f $repositoryName ; }; fi #sudo command only on error + if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Permissions Error: try running the update as sudo"; exit 1; } ; fi git clone "https://github.com/$githubUserName/$repositoryName" || { echo "Couldn't download latest version" ; exit 1; } cd $repositoryName || { echo 'Update Failed' ; exit 1 ;} git checkout "v$latestVersion" 2> /dev/null || git checkout "$latestVersion" 2> /dev/null || echo "Couldn't git checkout to stable release, updating to latest commit." chmod a+x install.sh #this might be necessary in your case but wasnt in mine. - ./$nameOfInstallFile "update" || { echo "Your password is required to continue with the update" ; sudo ./$nameOfInstallFile "update" ; } + ./$nameOfInstallFile "update" || { echo "Permissions Error: try running the update as sudo"; exit 1; } cd .. - rm -r -f $repositoryName || sudo rm -r -f $repositoryName #sudo command only on error + rm -r -f $repositoryName || { echo "Permissions Error: update succesfull but cannot delete temp files located at ~/$repositoryName delete this directory with sudo"; exit 1; } else exit 1 fi