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

scripts: restore local plugins after an upgrade

This commit is contained in:
Pierre de La Morinerie 2021-12-26 09:54:59 +01:00
parent bffa9a48da
commit acbb2feeab

View file

@ -126,8 +126,9 @@ then
# 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 and local plugins in the temp dir
cp -a "$final_path/config/config.json" "$tmpdir/config.json" cp -a "$final_path/config/config.json" "$tmpdir/config.json"
cp -ar "$final_path/plugins" "$tmpdir/plugins"
# Remove the app directory securely # Remove the app directory securely
ynh_secure_remove --file="$final_path" ynh_secure_remove --file="$final_path"
@ -138,8 +139,9 @@ then
ynh_setup_source --dest_dir="$final_path" --source_id="$architecture" ynh_setup_source --dest_dir="$final_path" --source_id="$architecture"
fi fi
# Copy the admin saved settings from tmp directory to final path # Copy the admin saved settings and plugins from tmp directory to final path
cp -a "$tmpdir/config.json" "$final_path/config/config.json" cp -a "$tmpdir/config.json" "$final_path/config/config.json"
cp -ar --no-clobber "$tmpdir/plugins" "$final_path/"
# Remove the tmp directory securely # Remove the tmp directory securely
ynh_secure_remove --file="$tmpdir" ynh_secure_remove --file="$tmpdir"