1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/wekan_ynh.git synced 2024-09-03 20:36:09 +02:00

remove previous sources during upgrade

This commit is contained in:
yalh76 2019-07-13 21:19:48 +02:00
parent d5c6261967
commit 1cfd8eed14

View file

@ -156,9 +156,24 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_print_info --message="Upgrading source files..."
# Create a temporary directory
tmpdir="$(mktemp -d)"
# Backup the env file in the temp dir
cp -a "$final_path/.env" "$tmpdir/.env"
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
architecture=$(ynh_detect_arch)
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture"
#Copy the admin saved settings from tmp directory to final path
cp -a "$tmpdir/.env" "$final_path/.env"
# Remove the tmp directory securely
ynh_secure_remove --file="$tmpdir"
fi
#=================================================