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

Update upgrade

This commit is contained in:
ericgaspar 2020-12-26 19:18:26 +01:00
parent ea59adff9f
commit 7691d27aa3
No known key found for this signature in database
GPG key ID: 574F281483054D44

View file

@ -62,31 +62,11 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." --weight=5 ynh_script_progression --message="Upgrading source files..." --weight=5
if [[ ! -f "$final_path/data" ]]; then
# config.ini.php is only created during the post-install process...
# it is therefore not present when the CI tests are carried out...
# This condition is only for CI test to go through the upgrade process
ynh_secure_remove --file="$final_path"
# Download, check integrity, uncompress and patch the source from app.src
ynh_setup_source --dest_dir="$final_path"
else
tmpdir="$(mktemp -d)"
# Backup the config file in the temp dir
cp -a "$final_path/data" "$tmpdir/data"
# 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 # 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 the admin saved settings from tmp directory to final path
cp -a "$tmpdir/data" "$final_path/config/data"
# Remove the tmp directory securely
ynh_secure_remove --file="$tmpdir"
fi fi
#================================================= #=================================================
@ -113,6 +93,15 @@ ynh_script_progression --message="Upgrading PHP-FPM configuration..." --weight=1
# Create a dedicated php-fpm config # Create a dedicated php-fpm config
ynh_add_fpm_config --package="$extra_php_dependencies" ynh_add_fpm_config --package="$extra_php_dependencies"
#=================================================
# MODIFY A CONFIG FILE
#=================================================
cp -a ../conf/config-dist.php "$final_path/data/config.php"
ynh_replace_string --match_string="__LANGUAGE__" --replace_string="$language" --target_file="$final_path/data/config.php"
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES
#================================================= #=================================================