1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/digisteps_ynh.git synced 2024-09-03 18:26:21 +02:00

Merge pull request #3 from YunoHost-Apps/testing

Restore the .db file after upgrade
This commit is contained in:
Melchisedech 2022-02-26 10:55:54 +01:00 committed by GitHub
commit eb58f5445d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -109,9 +109,24 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
if [ "$upgrade_type" == "UPGRADE_APP" ] if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." --time --weight=1 ynh_script_progression --message="Upgrading source files..." --time --weight=1
# Create a temporary directory
tmpdir="$(mktemp -d)"
# Backup the inc/digiwords.db file to the temp dir
cp -ar "$final_path/inc/digiwords.db" "$tmpdir/digiwords.db"
# Remove the app directory securely
ynh_secure_remove --file=$final_path
# Download, check integrity, uncompress and patch the source from app.src # Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path" ynh_setup_source --dest_dir="$final_path"
# Copy digiwords.db back to the final_path
cp -ar "$tmpdir/digiwords.db" "$final_path/inc/digiwords.db"
# Remove the tmp directory securely
ynh_secure_remove --file="$tmpdir"
fi fi
# FIXME: this should be managed by the core in the future # FIXME: this should be managed by the core in the future
@ -150,8 +165,6 @@ ynh_add_fpm_config
#================================================= #=================================================
# SPECIFIC UPGRADE # SPECIFIC UPGRADE
#================================================= #=================================================
# ...
#=================================================
#================================================= #=================================================
# GENERIC FINALIZATION # GENERIC FINALIZATION