diff --git a/cheat/cheat b/cheat/cheat index b359046..7a22a9d 100755 --- a/cheat/cheat +++ b/cheat/cheat @@ -46,7 +46,7 @@ checkInternet() update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 + # Update utility version 2.2.0 # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein @@ -65,15 +65,19 @@ update() echo -n "Do you wish to update $repositoryName [Y/n]: " read -r answer if [[ "$answer" == [Yy] ]]; then - cd ~ || { echo 'Update Failed'; exit 1; } + cd ~ || { echo 'Update Failed'; exit 1; } 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; } + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" 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" || exit 1 cd .. - rm -r -f $repositoryName || { echo "Permissions Error: update succesfull but cannot delete temp files located at ~/$repositoryName delete this directory with sudo"; exit 1; } + 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 @@ -81,7 +85,6 @@ update() echo "$repositoryName is already the latest version" fi fi - } usage() diff --git a/cloudup/cloudup b/cloudup/cloudup index a341fb6..baa9520 100755 --- a/cloudup/cloudup +++ b/cloudup/cloudup @@ -43,7 +43,7 @@ checkInternet() update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 + # Update utility version 2.2.0 # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein @@ -61,11 +61,15 @@ update() echo "Version $latestVersion available" echo -n "Do you wish to update $repositoryName [Y/n]: " read -r answer - if [[ "$answer" == [Yy] ]] ;then - cd ~ || { echo 'Update Failed'; exit 1; } + if [[ "$answer" == [Yy] ]]; then + cd ~ || { echo 'Update Failed'; exit 1; } 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; } + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" + 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" || exit 1 diff --git a/crypt/crypt b/crypt/crypt index 1d4f8f0..46682fd 100755 --- a/crypt/crypt +++ b/crypt/crypt @@ -67,7 +67,7 @@ decrypt() update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 + # Update utility version 2.2.0 # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein @@ -86,12 +86,16 @@ update() echo -n "Do you wish to update $repositoryName [Y/n]: " read -r answer if [[ "$answer" == [Yy] ]]; then - cd ~ || { echo 'Update Failed'; exit 1; } + cd ~ || { echo 'Update Failed'; exit 1; } 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; } + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" 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 wasn't in mine. + chmod a+x install.sh #this might be necessary in your case but wasnt in mine. ./$nameOfInstallFile "update" || exit 1 cd .. rm -r -f $repositoryName || { echo "Permissions Error: update succesfull but cannot delete temp files located at ~/$repositoryName delete this directory with sudo"; exit 1; } diff --git a/cryptocurrency/cryptocurrency b/cryptocurrency/cryptocurrency index fb6fc8e..77f81fd 100755 --- a/cryptocurrency/cryptocurrency +++ b/cryptocurrency/cryptocurrency @@ -190,8 +190,8 @@ EOF update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 - # To test the tool enter in the default values that are in the examples for each variable + # Update utility version 2.2.0 + # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein nameOfInstallFile="install.sh" # change this if the installer file has a different name be sure to include file extension if there is one @@ -209,10 +209,14 @@ update() echo -n "Do you wish to update $repositoryName [Y/n]: " read -r answer if [[ "$answer" == [Yy] ]]; then - cd ~ || { echo 'Update Failed'; exit 1; } + cd ~ || { echo 'Update Failed'; exit 1; } 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 ;} + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" + 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" || exit 1 diff --git a/currency/currency b/currency/currency index 83a77fb..03451d4 100755 --- a/currency/currency +++ b/currency/currency @@ -161,8 +161,8 @@ EOF update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 - # To test the tool enter in the default values that are in the examples for each variable + # Update utility version 2.2.0 + # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein nameOfInstallFile="install.sh" # change this if the installer file has a different name be sure to include file extension if there is one @@ -180,10 +180,14 @@ update() echo -n "Do you wish to update $repositoryName [Y/n]: " read -r answer if [[ "$answer" == [Yy] ]]; then - cd ~ || { echo 'Update Failed'; exit 1; } + cd ~ || { echo 'Update Failed'; exit 1; } 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 ;} + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" + 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" || exit 1 diff --git a/extras/Linux/maps/maps b/extras/Linux/maps/maps index dc339ce..69bea03 100755 --- a/extras/Linux/maps/maps +++ b/extras/Linux/maps/maps @@ -46,12 +46,12 @@ checkInternet() update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 + # Update utility version 2.2.0 # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein nameOfInstallFile="install.sh" # change this if the installer file has a different name be sure to include file extension if there is one - latestVersion=$(httpGet https://api.github.com/repos/$githubUserName/$repositoryName/tags | grep -Eo '"name":.*?[^\\]",'| head -1 | grep -Eo "[0-9.]+") #always grabs the tag without the v option + latestVersion=$(httpGet https://api.github.com/repos/$githubUserName/$repositoryName/tags | grep -Eo '"name":.*?[^\\]",'| head -1 | grep -Eo "[0-9.]+" ) #always grabs the tag without the v option if [[ $currentVersion == "" || $repositoryName == "" || $githubUserName == "" || $nameOfInstallFile == "" ]]; then echo "Error: update utility has not been configured correctly." >&2 @@ -66,11 +66,15 @@ update() read -r answer if [[ "$answer" == [Yy] ]]; then cd ~ || { echo 'Update Failed'; exit 1; } - 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; } + if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Permissions Error: try running the update as sudo"; exit 1; } ; fi + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" 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 wasn't in mine. + chmod a+x install.sh #this might be necessary in your case but wasnt in mine. ./$nameOfInstallFile "update" || exit 1 cd .. rm -r -f $repositoryName || { echo "Permissions Error: update succesfull but cannot delete temp files located at ~/$repositoryName delete this directory with sudo"; exit 1; } diff --git a/geo/geo b/geo/geo index 7f7f28d..e5eba8a 100755 --- a/geo/geo +++ b/geo/geo @@ -133,9 +133,10 @@ specific_geo() { fi } -update() { +update() +{ # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 + # Update utility version 2.2.0 # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein @@ -153,11 +154,15 @@ update() { echo "Version $latestVersion available" echo -n "Do you wish to update $repositoryName [Y/n]: " read -r answer - if [[ "$answer" == [Yy] ]] ;then - cd ~ || { echo 'Update Failed'; exit 1; } + if [[ "$answer" == [Yy] ]]; then + cd ~ || { echo 'Update Failed'; exit 1; } 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 ;} + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" + 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" || exit 1 diff --git a/movies/movies b/movies/movies index 8ef76aa..29fe261 100755 --- a/movies/movies +++ b/movies/movies @@ -118,7 +118,7 @@ printMovieInfo() update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 + # Update utility version 2.2.0 # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein @@ -128,7 +128,7 @@ update() if [[ $currentVersion == "" || $repositoryName == "" || $githubUserName == "" || $nameOfInstallFile == "" ]]; then echo "Error: update utility has not been configured correctly." >&2 exit 1 - elif [[ $latestVersion == "" ]];then + elif [[ $latestVersion == "" ]]; then echo "Error: no active internet connection" >&2 exit 1 else @@ -137,10 +137,14 @@ update() echo -n "Do you wish to update $repositoryName [Y/n]: " read -r answer if [[ "$answer" == [Yy] ]]; then - cd ~ || { echo 'Update Failed' ; exit 1; } + cd ~ || { echo 'Update Failed'; exit 1; } 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; } + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" + 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" || exit 1 @@ -153,7 +157,6 @@ update() echo "$repositoryName is already the latest version" fi fi - } usage() diff --git a/newton/newton b/newton/newton index 66aeec4..3f2051f 100755 --- a/newton/newton +++ b/newton/newton @@ -44,7 +44,7 @@ checkInternet() update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 + # Update utility version 2.2.0 # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein @@ -62,11 +62,15 @@ update() echo "Version $latestVersion available" echo -n "Do you wish to update $repositoryName [Y/n]: " read -r answer - if [[ "$answer" == [Yy] ]] ;then - cd ~ || { echo 'Update Failed'; exit 1; } + if [[ "$answer" == [Yy] ]]; then + cd ~ || { echo 'Update Failed'; exit 1; } 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; } + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" + 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" || exit 1 diff --git a/qrify/qrify b/qrify/qrify index 31b0e76..f037cc1 100755 --- a/qrify/qrify +++ b/qrify/qrify @@ -36,39 +36,43 @@ httpGet() update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 + # Update utility version 2.2.0 # To test the tool enter in the defualt values that are in the examples for each variable - repositoryName="Bash-Snippets" # Name of repostiory to be updated ex. Sandman-Lite - githubUserName="alexanderepstein" # username that hosts the repostiory ex. alexanderepstein + repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite + githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein nameOfInstallFile="install.sh" # change this if the installer file has a different name be sure to include file extension if there is one - latestVersion=$(httpGet https://api.github.com/repos/$githubUserName/$repositoryName/tags | grep -Eo '"name":.*?[^\\]",'| head -1 | grep -Eo "[0-9.]+" ) # always grabs the tag without the v option + latestVersion=$(httpGet https://api.github.com/repos/$githubUserName/$repositoryName/tags | grep -Eo '"name":.*?[^\\]",'| head -1 | grep -Eo "[0-9.]+" ) #always grabs the tag without the v option - if [[ ${currentVersion} == "" || ${repositoryName} == "" || ${githubUserName} == "" || ${nameOfInstallFile} == "" ]]; then + if [[ $currentVersion == "" || $repositoryName == "" || $githubUserName == "" || $nameOfInstallFile == "" ]]; then echo "Error: update utility has not been configured correctly." >&2 exit 1 - elif [[ ${latestVersion} == "" ]];then + elif [[ $latestVersion == "" ]]; then echo "Error: no active internet connection" >&2 exit 1 else - if [[ "${latestVersion}" != "${currentVersion}" ]]; then - echo "Version ${latestVersion} available" - echo -n "Do you wish to update ${repositoryName} [Y/n]: " + if [[ "$latestVersion" != "$currentVersion" ]]; then + echo "Version $latestVersion available" + echo -n "Do you wish to update $repositoryName [Y/n]: " read -r answer - if [[ "${answer}" == [Yy] ]]; then + if [[ "$answer" == [Yy] ]]; then cd ~ || { echo 'Update Failed'; exit 1; } - 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 wasn't in mine. - ./${nameOfInstallFile} "update" || exit 1 + if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Permissions Error: try running the update as sudo"; exit 1; } ; fi + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" + 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" || exit 1 cd .. - rm -r -f ${repositoryName} || { echo "Permissions Error: update succesfull but cannot delete temp files located at ~/${repositoryName} delete this directory with sudo"; exit 1; } + 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 else - echo "${repositoryName} is already the latest version" + echo "$repositoryName is already the latest version" fi fi } diff --git a/short/short b/short/short index 46adce4..a6c4ecb 100755 --- a/short/short +++ b/short/short @@ -65,7 +65,7 @@ checkInternet() update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 + # Update utility version 2.2.0 # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein @@ -84,9 +84,13 @@ update() echo -n "Do you wish to update $repositoryName [Y/n]: " read -r answer if [[ "$answer" == [Yy] ]]; then - cd ~ || { echo 'Update Failed'; exit 1; } + cd ~ || { echo 'Update Failed'; exit 1; } 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; } + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" 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. diff --git a/siteciphers/siteciphers b/siteciphers/siteciphers index 8844945..9cef644 100755 --- a/siteciphers/siteciphers +++ b/siteciphers/siteciphers @@ -44,7 +44,7 @@ httpGet() update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 + # Update utility version 2.2.0 # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein @@ -63,9 +63,13 @@ update() echo -n "Do you wish to update $repositoryName [Y/n]: " read -r answer if [[ "$answer" == [Yy] ]]; then - cd ~ || { echo 'Update Failed'; exit 1; } + cd ~ || { echo 'Update Failed'; exit 1; } 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; } + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" 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. diff --git a/stocks/stocks b/stocks/stocks index d890b06..b06cb00 100755 --- a/stocks/stocks +++ b/stocks/stocks @@ -116,7 +116,7 @@ getTicker() update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 + # Update utility version 2.2.0 # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein @@ -135,9 +135,13 @@ update() echo -n "Do you wish to update $repositoryName [Y/n]: " read -r answer if [[ "$answer" == [Yy] ]]; then - cd ~ || { echo 'Update Failed'; exit 1; } + cd ~ || { echo 'Update Failed'; exit 1; } 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; } + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" 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. diff --git a/taste/taste b/taste/taste index f74f353..4fcdfb9 100755 --- a/taste/taste +++ b/taste/taste @@ -67,7 +67,7 @@ checkInternet() update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 + # Update utility version 2.2.0 # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein @@ -87,8 +87,12 @@ update() read -r answer if [[ "$answer" == [Yy] ]]; then cd ~ || { echo 'Update Failed'; exit 1; } - 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; } + if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Permissions Error: try running the update as sudo"; exit 1; } ; fi + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" 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. diff --git a/todo/todo b/todo/todo index 77b0557..e789277 100755 --- a/todo/todo +++ b/todo/todo @@ -35,7 +35,7 @@ httpGet() update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 + # Update utility version 2.2.0 # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein @@ -56,7 +56,11 @@ update() if [[ "$answer" == [Yy] ]]; then cd ~ || { echo 'Update Failed'; exit 1; } 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; } + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" 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. diff --git a/transfer/transfer b/transfer/transfer index 3f2832a..5ef11cb 100755 --- a/transfer/transfer +++ b/transfer/transfer @@ -76,7 +76,7 @@ httpDownload() update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 + # Update utility version 2.2.0 # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein @@ -97,7 +97,11 @@ update() if [[ "$answer" == [Yy] ]]; then cd ~ || { echo 'Update Failed'; exit 1; } 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; } + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" 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. diff --git a/weather/weather b/weather/weather index f013a8c..daf96e4 100755 --- a/weather/weather +++ b/weather/weather @@ -62,7 +62,7 @@ checkInternet() update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 + # Update utility version 2.2.0 # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein @@ -83,7 +83,11 @@ update() if [[ "$answer" == [Yy] ]]; then cd ~ || { echo 'Update Failed'; exit 1; } 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; } + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" 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. @@ -158,7 +162,7 @@ elif [[ $1 == "update" ]]; then exit 0 fi -checkInternet || exit 1 +checkInternet || exit 1 if [[ $1 == "m" ]]; then getIPWeather "?m" || exit 1 elif [[ "${@: -1}" == "m" ]];then diff --git a/ytview/ytview b/ytview/ytview index 0e50e22..beecb58 100755 --- a/ytview/ytview +++ b/ytview/ytview @@ -45,7 +45,7 @@ checkInternet() update() { # Author: Alexander Epstein https://github.com/alexanderepstein - # Update utility version 1.2.0 + # Update utility version 2.2.0 # To test the tool enter in the defualt values that are in the examples for each variable repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein @@ -65,8 +65,12 @@ update() read -r answer if [[ "$answer" == [Yy] ]]; then cd ~ || { echo 'Update Failed'; exit 1; } - 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; } + if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Permissions Error: try running the update as sudo"; exit 1; } ; fi + echo -n "Downloading latest version of: $repositoryName." + git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; exit 1; } & + while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done + rm -f .BSnippetsHiddenFile + echo "Success!" 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.