1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/digitranscode_ynh.git synced 2024-09-03 18:25:59 +02:00

Check if digiwords.db exists

Because it’s not included anymore in upstream packages.
This commit is contained in:
Melchisedech 2022-03-01 19:06:34 +01:00 committed by GitHub
parent 34821444c1
commit 4d60a6c53c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -110,23 +110,30 @@ 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 # Test because file doesnt exist at first install. It is created at first page opening.
tmpdir="$(mktemp -d)" if test -f "$final_path/inc/digiwords.db"
then
# Create a temporary directory
tmpdir="$(mktemp -d)"
# Backup the inc/digiwords.db file to the temp dir # Backup the inc/digiwords.db file to the temp dir
cp -ar "$final_path/inc/digiwords.db" "$tmpdir/digiwords.db" cp -ar "$final_path/inc/digiwords.db" "$tmpdir/digiwords.db"
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove --file=$final_path 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 digiwords.db back to the final_path
cp -ar "$tmpdir/digiwords.db" "$final_path/inc/digiwords.db"
# Download, check integrity, uncompress and patch the source from app.src # Remove the tmp directory securely
ynh_setup_source --dest_dir="$final_path" ynh_secure_remove --file="$tmpdir"
else
# Copy digiwords.db back to the final_path # Download, check integrity, uncompress and patch the source from app.src
cp -ar "$tmpdir/digiwords.db" "$final_path/inc/digiwords.db" ynh_setup_source --dest_dir="$final_path"
fi
# 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