mirror of
https://github.com/alexanderepstein/Bash-Snippets
synced 2018-11-08 02:59:35 +01:00
Replcaing git clone progress with my own during update
This commit is contained in:
parent
5a9689a5d5
commit
286815c4ba
@ -46,7 +46,7 @@ checkInternet()
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
||||||
@ -67,7 +67,11 @@ update()
|
|||||||
if [[ "$answer" == [Yy] ]]; then
|
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
|
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; }
|
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."
|
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.
|
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||||
@ -81,7 +85,6 @@ update()
|
|||||||
echo "$repositoryName is already the latest version"
|
echo "$repositoryName is already the latest version"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
usage()
|
usage()
|
||||||
|
@ -43,7 +43,7 @@ checkInternet()
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
||||||
@ -61,10 +61,14 @@ update()
|
|||||||
echo "Version $latestVersion available"
|
echo "Version $latestVersion available"
|
||||||
echo -n "Do you wish to update $repositoryName [Y/n]: "
|
echo -n "Do you wish to update $repositoryName [Y/n]: "
|
||||||
read -r answer
|
read -r answer
|
||||||
if [[ "$answer" == [Yy] ]] ;then
|
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
|
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; }
|
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."
|
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.
|
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||||
|
10
crypt/crypt
10
crypt/crypt
@ -67,7 +67,7 @@ decrypt()
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
||||||
@ -88,10 +88,14 @@ update()
|
|||||||
if [[ "$answer" == [Yy] ]]; then
|
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
|
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; }
|
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."
|
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
|
./$nameOfInstallFile "update" || exit 1
|
||||||
cd ..
|
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; }
|
||||||
|
@ -190,8 +190,8 @@ EOF
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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 default values that are in the examples for each variable
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
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
|
nameOfInstallFile="install.sh" # change this if the installer file has a different name be sure to include file extension if there is one
|
||||||
@ -211,8 +211,12 @@ update()
|
|||||||
if [[ "$answer" == [Yy] ]]; then
|
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
|
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."
|
||||||
cd $repositoryName || { echo 'Update Failed' ; exit 1 ;}
|
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."
|
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.
|
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||||
./$nameOfInstallFile "update" || exit 1
|
./$nameOfInstallFile "update" || exit 1
|
||||||
|
@ -161,8 +161,8 @@ EOF
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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 default values that are in the examples for each variable
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
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
|
nameOfInstallFile="install.sh" # change this if the installer file has a different name be sure to include file extension if there is one
|
||||||
@ -182,8 +182,12 @@ update()
|
|||||||
if [[ "$answer" == [Yy] ]]; then
|
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
|
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."
|
||||||
cd $repositoryName || { echo 'Update Failed' ; exit 1 ;}
|
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."
|
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.
|
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||||
./$nameOfInstallFile "update" || exit 1
|
./$nameOfInstallFile "update" || exit 1
|
||||||
|
@ -46,12 +46,12 @@ checkInternet()
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
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
|
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
|
echo "Error: update utility has not been configured correctly." >&2
|
||||||
@ -66,11 +66,15 @@ update()
|
|||||||
read -r answer
|
read -r answer
|
||||||
if [[ "$answer" == [Yy] ]]; then
|
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
|
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; }
|
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."
|
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
|
./$nameOfInstallFile "update" || exit 1
|
||||||
cd ..
|
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; }
|
||||||
|
15
geo/geo
15
geo/geo
@ -133,9 +133,10 @@ specific_geo() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
update() {
|
update()
|
||||||
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
||||||
@ -153,11 +154,15 @@ update() {
|
|||||||
echo "Version $latestVersion available"
|
echo "Version $latestVersion available"
|
||||||
echo -n "Do you wish to update $repositoryName [Y/n]: "
|
echo -n "Do you wish to update $repositoryName [Y/n]: "
|
||||||
read -r answer
|
read -r answer
|
||||||
if [[ "$answer" == [Yy] ]] ;then
|
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
|
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."
|
||||||
cd $repositoryName || { echo 'Update Failed' ; exit 1 ;}
|
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."
|
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.
|
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||||
./$nameOfInstallFile "update" || exit 1
|
./$nameOfInstallFile "update" || exit 1
|
||||||
|
@ -118,7 +118,7 @@ printMovieInfo()
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
||||||
@ -128,7 +128,7 @@ update()
|
|||||||
if [[ $currentVersion == "" || $repositoryName == "" || $githubUserName == "" || $nameOfInstallFile == "" ]]; then
|
if [[ $currentVersion == "" || $repositoryName == "" || $githubUserName == "" || $nameOfInstallFile == "" ]]; then
|
||||||
echo "Error: update utility has not been configured correctly." >&2
|
echo "Error: update utility has not been configured correctly." >&2
|
||||||
exit 1
|
exit 1
|
||||||
elif [[ $latestVersion == "" ]];then
|
elif [[ $latestVersion == "" ]]; then
|
||||||
echo "Error: no active internet connection" >&2
|
echo "Error: no active internet connection" >&2
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
@ -137,10 +137,14 @@ update()
|
|||||||
echo -n "Do you wish to update $repositoryName [Y/n]: "
|
echo -n "Do you wish to update $repositoryName [Y/n]: "
|
||||||
read -r answer
|
read -r answer
|
||||||
if [[ "$answer" == [Yy] ]]; then
|
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
|
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."
|
||||||
cd $repositoryName || { echo 'Update Failed' ; exit 1; }
|
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."
|
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.
|
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||||
./$nameOfInstallFile "update" || exit 1
|
./$nameOfInstallFile "update" || exit 1
|
||||||
@ -153,7 +157,6 @@ update()
|
|||||||
echo "$repositoryName is already the latest version"
|
echo "$repositoryName is already the latest version"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
usage()
|
usage()
|
||||||
|
@ -44,7 +44,7 @@ checkInternet()
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
||||||
@ -62,10 +62,14 @@ update()
|
|||||||
echo "Version $latestVersion available"
|
echo "Version $latestVersion available"
|
||||||
echo -n "Do you wish to update $repositoryName [Y/n]: "
|
echo -n "Do you wish to update $repositoryName [Y/n]: "
|
||||||
read -r answer
|
read -r answer
|
||||||
if [[ "$answer" == [Yy] ]] ;then
|
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
|
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; }
|
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."
|
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.
|
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||||
|
40
qrify/qrify
40
qrify/qrify
@ -36,39 +36,43 @@ httpGet()
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" # username that hosts the repostiory ex. alexanderepstein
|
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
|
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
|
echo "Error: update utility has not been configured correctly." >&2
|
||||||
exit 1
|
exit 1
|
||||||
elif [[ ${latestVersion} == "" ]];then
|
elif [[ $latestVersion == "" ]]; then
|
||||||
echo "Error: no active internet connection" >&2
|
echo "Error: no active internet connection" >&2
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
if [[ "${latestVersion}" != "${currentVersion}" ]]; then
|
if [[ "$latestVersion" != "$currentVersion" ]]; then
|
||||||
echo "Version ${latestVersion} available"
|
echo "Version $latestVersion available"
|
||||||
echo -n "Do you wish to update ${repositoryName} [Y/n]: "
|
echo -n "Do you wish to update $repositoryName [Y/n]: "
|
||||||
read -r answer
|
read -r answer
|
||||||
if [[ "${answer}" == [Yy] ]]; then
|
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
|
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."
|
||||||
cd ${repositoryName} || { echo 'Update Failed'; exit 1; }
|
git clone -q "https://github.com/$githubUserName/$repositoryName" && touch .BSnippetsHiddenFile || { echo "Failure!"; 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."
|
while [ ! -f .BSnippetsHiddenFile ]; do { echo -n "."; sleep 2; };done
|
||||||
chmod a+x install.sh # this might be necessary in your case but wasn't in mine.
|
rm -f .BSnippetsHiddenFile
|
||||||
./${nameOfInstallFile} "update" || exit 1
|
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 ..
|
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
|
else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "${repositoryName} is already the latest version"
|
echo "$repositoryName is already the latest version"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ checkInternet()
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
||||||
@ -86,7 +86,11 @@ update()
|
|||||||
if [[ "$answer" == [Yy] ]]; then
|
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
|
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; }
|
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."
|
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.
|
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||||
|
@ -44,7 +44,7 @@ httpGet()
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
||||||
@ -65,7 +65,11 @@ update()
|
|||||||
if [[ "$answer" == [Yy] ]]; then
|
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
|
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; }
|
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."
|
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.
|
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||||
|
@ -116,7 +116,7 @@ getTicker()
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
||||||
@ -137,7 +137,11 @@ update()
|
|||||||
if [[ "$answer" == [Yy] ]]; then
|
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
|
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; }
|
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."
|
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.
|
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||||
|
10
taste/taste
10
taste/taste
@ -67,7 +67,7 @@ checkInternet()
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
||||||
@ -87,8 +87,12 @@ update()
|
|||||||
read -r answer
|
read -r answer
|
||||||
if [[ "$answer" == [Yy] ]]; then
|
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
|
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; }
|
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."
|
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.
|
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||||
|
@ -35,7 +35,7 @@ httpGet()
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
||||||
@ -56,7 +56,11 @@ update()
|
|||||||
if [[ "$answer" == [Yy] ]]; then
|
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
|
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; }
|
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."
|
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.
|
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||||
|
@ -76,7 +76,7 @@ httpDownload()
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
||||||
@ -97,7 +97,11 @@ update()
|
|||||||
if [[ "$answer" == [Yy] ]]; then
|
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
|
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; }
|
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."
|
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.
|
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||||
|
@ -62,7 +62,7 @@ checkInternet()
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
||||||
@ -83,7 +83,11 @@ update()
|
|||||||
if [[ "$answer" == [Yy] ]]; then
|
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
|
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; }
|
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."
|
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.
|
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||||
|
@ -45,7 +45,7 @@ checkInternet()
|
|||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
# Author: Alexander Epstein https://github.com/alexanderepstein
|
# 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
|
# 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
|
repositoryName="Bash-Snippets" #Name of repostiory to be updated ex. Sandman-Lite
|
||||||
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
githubUserName="alexanderepstein" #username that hosts the repostiory ex. alexanderepstein
|
||||||
@ -65,8 +65,12 @@ update()
|
|||||||
read -r answer
|
read -r answer
|
||||||
if [[ "$answer" == [Yy] ]]; then
|
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
|
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; }
|
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."
|
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.
|
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||||
|
Loading…
Reference in New Issue
Block a user