mirror of
https://github.com/mag37/dockcheck.git
synced 2026-02-20 10:14:21 +01:00
Cleaning
Quoted a variable, reformatted a message
This commit is contained in:
parent
fd67e0dff1
commit
4a2bc2dded
1 changed files with 2 additions and 2 deletions
|
|
@ -41,13 +41,13 @@ shift "$((OPTIND-1))"
|
||||||
self_update_git() {
|
self_update_git() {
|
||||||
cd "$ScriptWorkDir" || { printf "Path error, skipping update.\n" ; return ; }
|
cd "$ScriptWorkDir" || { printf "Path error, skipping update.\n" ; return ; }
|
||||||
[[ $(builtin type -P git) ]] || { printf "Git not installed, skipping update.\n" ; return ; }
|
[[ $(builtin type -P git) ]] || { printf "Git not installed, skipping update.\n" ; return ; }
|
||||||
ScriptUpstream=$(git rev-parse --abbrev-ref --symbolic-full-name @{upstream}) || { printf "Script not in cloned directory, skipping update.\n" ; return ; }
|
ScriptUpstream=$(git rev-parse --abbrev-ref --symbolic-full-name "@{upstream}") || { printf "Script not in cloned directory, skipping update.\n" ; return ; }
|
||||||
git fetch
|
git fetch
|
||||||
[ -n "$(git diff --name-only "$ScriptUpstream" "$ScriptName")" ] && {
|
[ -n "$(git diff --name-only "$ScriptUpstream" "$ScriptName")" ] && {
|
||||||
printf "%s\n" "Pulling the latest version."
|
printf "%s\n" "Pulling the latest version."
|
||||||
# git checkout "$ScriptUpstream"
|
# git checkout "$ScriptUpstream"
|
||||||
git pull --force
|
git pull --force
|
||||||
echo "Running the new version..."
|
printf "%s\n" "--- starting over with the updated version ---"
|
||||||
cd - || { printf "Path error.\n" ; return ; }
|
cd - || { printf "Path error.\n" ; return ; }
|
||||||
exec "$ScriptPath" "${ScriptArgs[@]}" # run the new script with old arguments
|
exec "$ScriptPath" "${ScriptArgs[@]}" # run the new script with old arguments
|
||||||
exit 1 # exit the old instance
|
exit 1 # exit the old instance
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue