1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hubzilla_ynh.git synced 2024-09-03 19:26:21 +02:00

Fix random_string check acc to YNH recommended way for upgrade

As setting variables are now loaded by default on package upgrade. So, no need to get the variables in the environment, but still it needs to checked for empty value and if it exists in the /app/setting.
This commit is contained in:
anmol26s 2023-10-14 21:29:40 +05:30 committed by GitHub
parent 9e9ea2b22d
commit 387ff9676c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,8 +15,6 @@ source /usr/share/yunohost/helpers
ynh_script_progression --message="Loading settings..." --weight=1
email=$(ynh_user_get_info --username=$admin --key=mail)
random_string=$(ynh_app_setting_get --app=$app --key=random_string)
#=================================================
# CHECK VERSION
@ -32,7 +30,7 @@ upgrade_type=$(ynh_check_app_version_changed)
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# If random_string doesn't exist, create it
if [ -z "$random_string" ]; then
if [ -z "${random_string:-}" ]; then
random_string="$(ynh_string_random --length=48)"
ynh_app_setting_set --app=$app --key=random_string --value=$random_string
fi