Replcaing git clone progress with my own during update
This commit is contained in:
parent
5a9689a5d5
commit
286815c4ba
|
@ -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
|
||||
|
@ -67,7 +67,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.
|
||||
|
@ -81,7 +85,6 @@ update()
|
|||
echo "$repositoryName is already the latest version"
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
usage()
|
||||
|
|
|
@ -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
|
||||
|
@ -64,7 +64,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.
|
||||
|
|
10
crypt/crypt
10
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
|
||||
|
@ -88,10 +88,14 @@ 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 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; }
|
||||
|
|
|
@ -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
|
||||
|
@ -211,7 +211,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.
|
||||
|
|
|
@ -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
|
||||
|
@ -182,7 +182,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.
|
||||
|
|
|
@ -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
|
||||
|
@ -67,10 +67,14 @@ 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 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; }
|
||||
|
|
11
geo/geo
11
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
|
||||
|
@ -156,7 +157,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.
|
||||
|
|
|
@ -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
|
||||
|
@ -139,7 +139,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.
|
||||
|
@ -153,7 +157,6 @@ update()
|
|||
echo "$repositoryName is already the latest version"
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
usage()
|
||||
|
|
|
@ -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
|
||||
|
@ -65,7 +65,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.
|
||||
|
|
34
qrify/qrify
34
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
|
||||
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
|
||||
|
||||
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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -86,7 +86,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.
|
||||
|
|
|
@ -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
|
||||
|
@ -65,7 +65,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.
|
||||
|
|
|
@ -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
|
||||
|
@ -137,7 +137,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.
|
||||
|
|
|
@ -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
|
||||
|
@ -88,7 +88,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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
@ -66,7 +66,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.
|
||||
|
|
Loading…
Reference in New Issue