Simplify self-update
This commit is contained in:
13
installJRMC
13
installJRMC
@@ -1648,18 +1648,15 @@ update_self() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Compare versions and update if necessary
|
# Get latest version number
|
||||||
local local_version
|
|
||||||
local_version=$(extract_version "$SCRIPT_PATH")
|
|
||||||
local remote_version
|
local remote_version
|
||||||
remote_version=$(extract_version "$tmp")
|
remote_version=$(extract_version "$tmp")
|
||||||
|
|
||||||
debug HERE
|
|
||||||
|
|
||||||
[[ -z $remote_version ]] && { rm -f "$tmp"; return 1; }
|
[[ -z $remote_version ]] && { rm -f "$tmp"; return 1; }
|
||||||
|
|
||||||
if [[ $local_version < $remote_version ]]; then
|
# Compare versions and update if necessary
|
||||||
echo "Newer version of installJRMC found. Updating..."
|
if [[ $SCRIPT_VERSION < $remote_version ]]; then
|
||||||
|
echo "Current installJRMC version: $SCRIPT_VERSION"
|
||||||
|
echo "Latest installJRMC version: $remote_version. Updating..."
|
||||||
execute mv "$tmp" "$SCRIPT_PATH"
|
execute mv "$tmp" "$SCRIPT_PATH"
|
||||||
execute chmod +x "$SCRIPT_PATH"
|
execute chmod +x "$SCRIPT_PATH"
|
||||||
exec "$SCRIPT_PATH" "$@" "--no-self-update"
|
exec "$SCRIPT_PATH" "$@" "--no-self-update"
|
||||||
|
|||||||
Reference in New Issue
Block a user