diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/app-init | 2 | ||||
-rwxr-xr-x | bin/app-upgrade | 20 |
2 files changed, 20 insertions, 2 deletions
diff --git a/bin/app-init b/bin/app-init index 8e571e8..7098cb3 100755 --- a/bin/app-init +++ b/bin/app-init @@ -66,7 +66,7 @@ resolved_version=`app-conf get app.resolved_version` if [[ $resolved_version == "" ]] then echo "Unable to resolve version" 2>&1 - exit + exit 1 fi echo "Resolved version to $resolved_version" diff --git a/bin/app-upgrade b/bin/app-upgrade index c6cd414..3c5f8dc 100755 --- a/bin/app-upgrade +++ b/bin/app-upgrade @@ -22,7 +22,7 @@ assert_is_app resolver_name=`app-conf get app.resolver` resolver=`find_resolver "$resolver_name"` -old_version=`app-conf get app.version` +old_version=`app-conf get app.resolved_version` echo "Resolving version $old_version" "$resolver" resolve-version new_version=`app-conf get app.resolved_version` @@ -35,6 +35,24 @@ fi echo "Resolved version to $new_version" +if [ "$new_version" = "" ] +then + new_version=`app-conf get app.resolved_version` +fi + +if [ "$new_version" = "" ] +then + fatal "app.resolved_version is not set." +fi + +installed_version=`app-conf get app.installed_version` + +if [ "$new_version" = "$installed_version" ] +then + echo "$new_version is already installed" + exit 0 +fi + "$resolver" download-version -v "$new_version" -f .app/latest.zip app-install-file -v "$new_version" -f .app/latest.zip |