diff --git a/scripts/install b/scripts/install index 93abf43..3972f51 100755 --- a/scripts/install +++ b/scripts/install @@ -98,7 +98,7 @@ ynh_add_nginx_config #================================================= ynh_script_progression --message="Creating a data directory..." --weight=2 -datadir=/home/yunohost.app/$app +datadir=/home/$app/.local/share/code-server ynh_app_setting_set --app=$app --key=datadir --value=$datadir mkdir -p $datadir/{user-data,extensions} diff --git a/scripts/upgrade b/scripts/upgrade index 0bf7d3a..76bb9cb 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -97,6 +97,18 @@ then mkdir -p $final_path fi +if ynh_compare_current_package_version -c le -v "4.1.0~ynh1" +then + new_datadir=/home/$app/.local/share/code-server + mkdir -p $new_datadir + + cp -R $datadir/* $new_datadir + ynh_secure_remove --file=$datadir + + datadir=new_datadir + ynh_app_setting_set --app=$app --key=datadir --value=$datadir +fi + #================================================= # DOWNLOAD, CHECK AND UNPACK SOURCE #=================================================