1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/matomo_ynh.git synced 2024-09-03 19:45:56 +02:00
This commit is contained in:
ericgaspar 2020-12-11 13:57:04 +01:00
parent 6cc63520f9
commit b8f750779f
No known key found for this signature in database
GPG key ID: 574F281483054D44

View file

@ -81,20 +81,24 @@ if [ "$upgrade_type" == "UPGRADE_APP" ]
then then
ynh_script_progression --message="Upgrading source files..." ynh_script_progression --message="Upgrading source files..."
if [ -z "$final_path/config/config.ini.php" ]; then
ynh_setup_source --dest_dir="$final_path"
else
# Create a temporary directory # Create a temporary directory
tmpdir="$(mktemp -d)" tmpdir="$(mktemp -d)"
# Backup the config file in the temp dir # Backup the config file in the temp dir
cp -a "$final_path/config" "$tmpdir" cp -a "$final_path/config/config.ini.php" "$tmpdir/config.ini.php"
# 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 # Copy the admin saved settings from tmp directory to final path
cp -a "$tmpdir" "$final_path/config" cp -a "$tmpdir/config.ini.php" "$final_path/config/config.ini.php"
# Remove the tmp directory securely # Remove the tmp directory securely
ynh_secure_remove --file="$tmpdir" ynh_secure_remove --file="$tmpdir"
fi
fi fi
#================================================= #=================================================
@ -131,7 +135,10 @@ ynh_script_progression --message="Installating composer and dependencies..."
ynh_install_composer --phpversion="$phpversion" --workdir="$final_path" ynh_install_composer --phpversion="$phpversion" --workdir="$final_path"
cd "$final_path" && ynh_exec_as $app ./console core:update if [ -z "$final_path/config/config.ini.php" ]; then
cd "$final_path"
ynh_exec_as $app ./console core:update
fi
#================================================= #=================================================
# SETUP A CRON # SETUP A CRON