From f8c5f11894b7d0579bea6d583a776ada9de4a6b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Mon, 15 Mar 2021 22:56:41 +0100 Subject: [PATCH] Testing (#12) * Cleaning up --- manifest.json | 16 ++-------------- scripts/change_url | 1 - scripts/install | 5 ++--- scripts/upgrade | 17 +++++++---------- 4 files changed, 11 insertions(+), 28 deletions(-) diff --git a/manifest.json b/manifest.json index 00cadcb..a12dabd 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "A 2048 variant with Euro coins and notes.", "fr": "Une variante 2048 avec pièces et billets en euros." }, - "version": "1.0~ynh3", + "version": "1.0~ynh4", "url": "https://github.com/jatekos101/20euros", "license": "MIT", "maintainer": { @@ -14,7 +14,7 @@ "email": "" }, "requirements": { - "yunohost": ">= 4.0.0" + "yunohost": ">= 4.1.7" }, "multi_instance": true, "services": [ @@ -25,29 +25,17 @@ { "name": "domain", "type": "domain", - "ask": { - "en": "Choose a domain for 20 euros", - "fr": "Choisissez un nom de domaine pour 20 euros" - }, "example": "domain.org" }, { "name": "path", "type": "path", - "ask": { - "en": "Choose a path for 20 euros", - "fr": "Choisissez un chemin pour 20 euros" - }, "example": "/20euros", "default": "/20euros" }, { "name": "is_public", "type": "boolean", - "ask": { - "en": "Is it a public game?", - "fr": "Est-ce un jeu public ?" - }, "help": { "en": "If enabled, 20 euros will be accessible by people who doesn’t have an account. This can be changed later via the webadmin.", "fr": "Si cette case est cochée, 20 euros sera accessible aux personnes n’ayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin." diff --git a/scripts/change_url b/scripts/change_url index 8a3e46b..183c971 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -7,7 +7,6 @@ #================================================= source /usr/share/yunohost/helpers - ynh_abort_if_errors #================================================= diff --git a/scripts/install b/scripts/install index beb9911..024573c 100755 --- a/scripts/install +++ b/scripts/install @@ -42,9 +42,8 @@ ynh_webpath_register --app=$app --domain=$domain --path_url=$path_url #================================================= ynh_script_progression --message="Storing installation settings..." --weight=2 -ynh_app_setting_set --app=$app --key=domain --value=$domain -ynh_app_setting_set --app=$app --key=path --value=$path_url -ynh_app_setting_set --app=$app --key=is_public --value=$is_public +ynh_app_setting_set --app=$app --key=domain --value=$domain +ynh_app_setting_set --app=$app --key=path --value=$path_url #================================================= # STANDARD MODIFICATIONS diff --git a/scripts/upgrade b/scripts/upgrade index 3ffc386..cf43934 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -17,7 +17,6 @@ app=$YNH_APP_INSTANCE_NAME domain=$(ynh_app_setting_get --app=$app --key=domain) path_url=$(ynh_app_setting_get --app=$app --key=path) -is_public=$(ynh_app_setting_get --app=$app --key=is_public) final_path=$(ynh_app_setting_get --app=$app --key=final_path) #================================================= @@ -31,21 +30,19 @@ upgrade_type=$(ynh_check_app_version_changed) #================================================= ynh_script_progression --message="Ensuring downward compatibility..." --weight=1 -# Fix is_public as a boolean value -if [ "$is_public" = "Yes" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=1 - is_public=1 -elif [ "$is_public" = "No" ]; then - ynh_app_setting_set --app=$app --key=is_public --value=0 - is_public=0 -fi - # If final_path doesn't exist, create it if [ -z "$final_path" ]; then final_path=/var/www/$app ynh_app_setting_set --app=$app --key=final_path --value=$final_path fi +# Cleaning legacy permissions +if ynh_legacy_permissions_exists; then + ynh_legacy_permissions_delete_all + + ynh_app_setting_delete --app=$app --key=is_public +fi + #================================================= # BACKUP BEFORE UPGRADE THEN ACTIVE TRAP #=================================================