From 8354fa9d1dadbd510624025f7755ef1d9c04d26b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Thu, 11 Jan 2024 00:17:14 +0100 Subject: [PATCH] On upgrade, pass --full_replace, --keep to ynh_setup_source, with the according doc. --- scripts/upgrade | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/upgrade b/scripts/upgrade index fab8a9a..18dc5ca 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -61,8 +61,13 @@ ynh_systemd_action --service_name="$app" --action="stop" --log_path="/var/log/$a #================================================= ynh_script_progression --message="Upgrading source files..." --weight=1 +### ynh_setup_source can wipe the destination dir if called with --full_replace. +### On upgrade, that is certainly what you want, to remove any old source file that +### does not exist in the new version of the software. +### You can list with --keep every file/directory to *not* wipe or overwrite, +### useful for configuration files, data directories, or plugins. # Download, check integrity, uncompress and patch the source from manifest.toml -ynh_setup_source --dest_dir="$install_dir" +ynh_setup_source --dest_dir="$install_dir" --full_replace=1 --keep=".env data" ### $install_dir will automatically be initialized with some decent ### permissions by default ... however, you may need to recursively reapply