Don't sudo on update error just let user know
This commit is contained in:
parent
13aa064895
commit
71c7c74c3d
|
@ -40,14 +40,14 @@ update()
|
|||
read -r answer
|
||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||
cd ~ || { echo 'Update Failed' ; exit 1 ; }
|
||||
if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Your password is required to continue with the update" ; sudo rm -r -f $repositoryName ; }; fi #sudo command only on error
|
||||
if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Permissions Error: try running the update as sudo"; exit 1; } ; fi
|
||||
git clone "https://github.com/$githubUserName/$repositoryName" || { echo "Couldn't download latest version" ; exit 1; }
|
||||
cd $repositoryName || { echo 'Update Failed' ; exit 1 ;}
|
||||
git checkout "v$latestVersion" 2> /dev/null || git checkout "$latestVersion" 2> /dev/null || echo "Couldn't git checkout to stable release, updating to latest commit."
|
||||
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||
./$nameOfInstallFile "update" || { echo "Your password is required to continue with the update" ; sudo ./$nameOfInstallFile "update" ; }
|
||||
./$nameOfInstallFile "update" || { echo "Permissions Error: try running the update as sudo"; exit 1; }
|
||||
cd ..
|
||||
rm -r -f $repositoryName || sudo rm -r -f $repositoryName #sudo command only on error
|
||||
rm -r -f $repositoryName || { echo "Permissions Error: update succesfull but cannot delete temp files located at ~/$repositoryName delete this directory with sudo"; exit 1; }
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -156,14 +156,14 @@ update()
|
|||
read -r answer
|
||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||
cd ~ || { echo 'Update Failed' ; exit 1 ; }
|
||||
if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Your password is required to continue with the update" ; sudo rm -r -f $repositoryName ; }; fi #sudo command only on error
|
||||
if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Permissions Error: try running the update as sudo"; exit 1; } ; fi
|
||||
git clone "https://github.com/$githubUserName/$repositoryName" || { echo "Couldn't download latest version" ; exit 1; }
|
||||
cd $repositoryName || { echo 'Update Failed' ; exit 1 ;}
|
||||
git checkout "v$latestVersion" 2> /dev/null || git checkout "$latestVersion" 2> /dev/null || echo "Couldn't git checkout to stable release, updating to latest commit."
|
||||
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||
./$nameOfInstallFile "update" || { echo "Your password is required to continue with the update" ; sudo ./$nameOfInstallFile "update" ; }
|
||||
./$nameOfInstallFile "update" || { echo "Permissions Error: try running the update as sudo"; exit 1; }
|
||||
cd ..
|
||||
rm -r -f $repositoryName || sudo rm -r -f $repositoryName #sudo command only on error
|
||||
rm -r -f $repositoryName || { echo "Permissions Error: update succesfull but cannot delete temp files located at ~/$repositoryName delete this directory with sudo"; exit 1; }
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -76,14 +76,14 @@ update()
|
|||
read -r answer
|
||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||
cd ~ || { echo 'Update Failed' ; exit 1 ; }
|
||||
if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Your password is required to continue with the update" ; sudo rm -r -f $repositoryName ; }; fi #sudo command only on error
|
||||
if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Permissions Error: try running the update as sudo"; exit 1; } ; fi
|
||||
git clone "https://github.com/$githubUserName/$repositoryName" || { echo "Couldn't download latest version" ; exit 1; }
|
||||
cd $repositoryName || { echo 'Update Failed' ; exit 1 ;}
|
||||
git checkout "v$latestVersion" 2> /dev/null || git checkout "$latestVersion" 2> /dev/null || echo "Couldn't git checkout to stable release, updating to latest commit."
|
||||
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||
./$nameOfInstallFile "update" || { echo "Your password is required to continue with the update" ; sudo ./$nameOfInstallFile "update" ; }
|
||||
./$nameOfInstallFile "update" || { echo "Permissions Error: try running the update as sudo"; exit 1; }
|
||||
cd ..
|
||||
rm -r -f $repositoryName || sudo rm -f -r $repositoryName #sudo command only on error
|
||||
rm -r -f $repositoryName || { echo "Permissions Error: update succesfull but cannot delete temp files located at ~/$repositoryName delete this directory with sudo"; exit 1; }
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -89,14 +89,14 @@ update()
|
|||
read -r answer
|
||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||
cd ~ || { echo 'Update Failed' ; exit 1 ; }
|
||||
if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Your password is required to continue with the update" ; sudo rm -r -f $repositoryName ; }; fi #sudo command only on error
|
||||
if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Permissions Error: try running the update as sudo"; exit 1; } ; fi
|
||||
git clone "https://github.com/$githubUserName/$repositoryName" || { echo "Couldn't download latest version" ; exit 1; }
|
||||
cd $repositoryName || { echo 'Update Failed' ; exit 1 ;}
|
||||
git checkout "v$latestVersion" 2> /dev/null || git checkout "$latestVersion" 2> /dev/null || echo "Couldn't git checkout to stable release, updating to latest commit."
|
||||
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||
./$nameOfInstallFile "update" || { echo "Your password is required to continue with the update" ; sudo ./$nameOfInstallFile "update" ; }
|
||||
./$nameOfInstallFile "update" || { echo "Permissions Error: try running the update as sudo"; exit 1; }
|
||||
cd ..
|
||||
rm -r -f $repositoryName || sudo rm -r -f $repositoryName #sudo command only on error
|
||||
rm -r -f $repositoryName || { echo "Permissions Error: update succesfull but cannot delete temp files located at ~/$repositoryName delete this directory with sudo"; exit 1; }
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
@ -57,14 +57,14 @@ update()
|
|||
read -r answer
|
||||
if [[ "$answer" == "Y" || "$answer" == "y" ]] ;then
|
||||
cd ~ || { echo 'Update Failed' ; exit 1 ; }
|
||||
if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Your password is required to continue with the update" ; sudo rm -r -f $repositoryName ; }; fi #sudo command only on error
|
||||
if [[ -d ~/$repositoryName ]]; then rm -r -f $repositoryName || { echo "Permissions Error: try running the update as sudo"; exit 1; } ; fi
|
||||
git clone "https://github.com/$githubUserName/$repositoryName" || { echo "Couldn't download latest version" ; exit 1; }
|
||||
cd $repositoryName || { echo 'Update Failed' ; exit 1 ;}
|
||||
git checkout "v$latestVersion" 2> /dev/null || git checkout "$latestVersion" 2> /dev/null || echo "Couldn't git checkout to stable release, updating to latest commit."
|
||||
chmod a+x install.sh #this might be necessary in your case but wasnt in mine.
|
||||
./$nameOfInstallFile "update" || { echo "Your password is required to continue with the update" ; sudo ./$nameOfInstallFile "update" ; }
|
||||
./$nameOfInstallFile "update" || { echo "Permissions Error: try running the update as sudo"; exit 1; }
|
||||
cd ..
|
||||
rm -r -f $repositoryName || sudo rm -r -f $repositoryName #sudo command only on error
|
||||
rm -r -f $repositoryName || { echo "Permissions Error: update succesfull but cannot delete temp files located at ~/$repositoryName delete this directory with sudo"; exit 1; }
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue