1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/20euros_ynh.git synced 2024-09-03 18:05:53 +02:00
* Cleaning up
This commit is contained in:
Éric Gaspar 2021-03-15 22:56:41 +01:00 committed by GitHub
parent a0d99466f5
commit f8c5f11894
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 28 deletions

View file

@ -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 doesnt have an account. This can be changed later via the webadmin.",
"fr": "Si cette case est cochée, 20 euros sera accessible aux personnes nayant pas de compte. Vous pourrez changer ceci plus tard via la webadmin."

View file

@ -7,7 +7,6 @@
#=================================================
source /usr/share/yunohost/helpers
ynh_abort_if_errors
#=================================================

View file

@ -44,7 +44,6 @@ 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
#=================================================
# STANDARD MODIFICATIONS

View file

@ -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
#=================================================