add version details to selfupgrade and fix earlier lint error
This commit is contained in:
@@ -98,8 +98,10 @@ function SelfUpgrade {
|
||||
local REMOTE="$(runcmd_stdout "cd $SCRIPT_DIR && git config --get remote.origin.url")"
|
||||
if [[ "$REMOTE" == *"ronivay/XenOrchestraInstallerUpdater"* ]]; then
|
||||
runcmd "cd $SCRIPT_DIR && git fetch"
|
||||
local OLD_SCRIPT_VERSION="$(runcmd_stdout "cd $SCRIPT_DIR && git rev-parse --short HEAD")"
|
||||
local NEW_SCRIPT_VERSION="$(runcmd_stdout "cd $SCRIPT_DIR && git rev-parse --short FETCH_HEAD")"
|
||||
if [[ $(runcmd_stdout "cd $SCRIPT_DIR && git diff --name-only @{upstream}| grep xo-install.sh") ]]; then
|
||||
printinfo "Newer version of script available, attempting to self upgrade"
|
||||
printinfo "Newer version of script available, attempting to self upgrade from '$OLD_SCRIPT_VERSION' to '$NEW_SCRIPT_VERSION'"
|
||||
runcmd "cd $SCRIPT_DIR && git pull --ff-only" &&
|
||||
{
|
||||
printok "Self upgrade done"
|
||||
|
Reference in New Issue
Block a user