1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00

[enh] Change the label during the migration

This commit is contained in:
Maniack Crudelis 2017-09-23 13:50:28 +02:00 committed by GitHub
parent 06199c7bdb
commit f83dd8d1d9

View file

@ -197,6 +197,17 @@ ynh_handle_app_migration () {
# That's why we use sed instead of app setting here. # That's why we use sed instead of app setting here.
# https://github.com/YunoHost/yunohost/blob/c6b5284be8da39cf2da4e1036a730eb5e0515096/src/yunohost/app.py#L1316-L1321 # 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 # MOVE FILES TO THE NEW DESTINATION
#================================================= #=================================================