From f83dd8d1d91902646b5c935a0a5758d1ea70c5e9 Mon Sep 17 00:00:00 2001 From: Maniack Crudelis Date: Sat, 23 Sep 2017 13:50:28 +0200 Subject: [PATCH] [enh] Change the label during the migration --- scripts/_common.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/_common.sh b/scripts/_common.sh index 78cde13..0067c7d 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -197,6 +197,17 @@ ynh_handle_app_migration () { # That's why we use sed instead of app setting here. # https://github.com/YunoHost/yunohost/blob/c6b5284be8da39cf2da4e1036a730eb5e0515096/src/yunohost/app.py#L1316-L1321 + # Change the label if it's simply the name of the app + old_label=$(ynh_app_setting_get $new_app label) + if [ "${old_label,,}" == "$old_app_id" ] + then + echo "new=$new_app_id" + # Build the new label from the id of the app. With the first character as upper case + new_label=$(echo $new_app_id | cut -c1 | tr [:lower:] [:upper:])$(echo $new_app_id | cut -c2-) + echo "new_label=$new_label" + ynh_app_setting_set $new_app label $new_label + fi + #================================================= # MOVE FILES TO THE NEW DESTINATION #=================================================