From 7479885c96c00166658e1df7ab4959dcddf8ac35 Mon Sep 17 00:00:00 2001 From: Rafi594 Date: Wed, 23 Oct 2019 13:31:21 +0200 Subject: [PATCH] Add version check in upgrade --- scripts/upgrade | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scripts/upgrade b/scripts/upgrade index 5962e1f..0e22561 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -30,6 +30,15 @@ servername=$(ynh_app_setting_get --app=$app --key=servername) #================================================= # ENSURE DOWNWARD COMPATIBILITY #================================================= +ynh_print_info --message="Checking version..." +version=ynh_app_upstream_version + +if [ "$version" = "0.01" ]; then +then +ynh_die --message="You can't upgrade to this version with simple upgrade. Please read the readme for upgrading https://github.com/YunoHost-Apps/minetest_ynh#additional-information ..." +fi + + ynh_print_info --message="Ensuring downward compatibility..." # Fix is_public as a boolean value @@ -97,6 +106,20 @@ ynh_print_info --message="Upgrading systemd configuration..." # Create a dedicated systemd config ynh_add_systemd_config +#================================================= +# COPY CONFIG FILE +#================================================= + +if [ -e /home/yunohost.app/$app ] +then +echo "Nothing to do..." +else +mkdir -p /home/yunohost.app/$app/.minetest/ +mkdir /home/yunohost.app/$app/.minetest/worlds/ +fi + +cp -a ../conf/minetest.conf /home/yunohost.app/$app/.minetest/ + #================================================= # SPECIFIC UPGRADE #=================================================