Replcaing git clone progress with my own during update

This commit is contained in:
Alex Epstein 2017-08-03 22:05:00 -04:00
parent 5a9689a5d5
commit 286815c4ba
18 changed files with 157 additions and 86 deletions

View File

@ -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()

View File

@ -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

View File

@ -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; }

View File

@ -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

View File

@ -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

View File

@ -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; }

17
geo/geo
View File

@ -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

View File

@ -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()

View File

@ -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

View File

@ -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
}

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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

View File

@ -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.