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

Update upgrade

This commit is contained in:
ericgaspar 2020-12-27 17:38:48 +01:00
parent f0ca9a64a7
commit cd7a006c10
No known key found for this signature in database
GPG key ID: 574F281483054D44

View file

@ -77,9 +77,25 @@ ynh_abort_if_errors
if [ "$upgrade_type" == "UPGRADE_APP" ]
then
ynh_script_progression --message="Upgrading source files..." --weight=4
tmpdir="$(mktemp -d)"
# Backup the config file in the temp dir
cp -a "$final_path/public/dist/user.css" "$tmpdir/user.css"
cp -R "$final_path/public/dist/uploads" "$tmpdir/uploads"
# Remove the app directory securely
ynh_secure_remove --file="$final_path"
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
# Copy the admin saved settings from tmp directory to final path
cp -a "$tmpdir/user.css" "$final_path/public/dist/user.css"
cp -R "$final_path/uploads" "$final_path/public/dist/uploads"
# Remove the tmp directory securely
ynh_secure_remove --file="$tmpdir"
fi
#=================================================
@ -128,9 +144,6 @@ ynh_backup_if_checksum_is_different --file="$final_path/.env"
# Recalculate and store the checksum of the file for the next upgrade.
ynh_store_file_checksum --file="$final_path/.env"
# Setup custom user.css file
cp ../conf/user.css.example $final_path/public/dist/user.css
#=================================================
# SECURE FILES AND DIRECTORIES
#=================================================