aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryalh76 <yalh@yahoo.com>2019-11-23 21:39:49 +0100
committerGitHub <noreply@github.com>2019-11-23 21:39:49 +0100
commit2462892ff1f1195a95245c01c4b0fba05fd75a45 (patch)
treede3c90ee7f8f45d0d9c7a11bf9ac2e55e779cf82
parent2183ce61cf4f6888aa5738bda6987f66e62be173 (diff)
parent95a5efb60811ae0062e7cda45b6875d979103dd2 (diff)
downloadmastodon_ynh-2462892ff1f1195a95245c01c4b0fba05fd75a45.tar.gz
mastodon_ynh-2462892ff1f1195a95245c01c4b0fba05fd75a45.tar.bz2
mastodon_ynh-2462892ff1f1195a95245c01c4b0fba05fd75a45.zip
Merge pull request #182 from YunoHost-Apps/fix_upgrade
Fix upgrade step
-rw-r--r--scripts/upgrade17
1 files changed, 12 insertions, 5 deletions
diff --git a/scripts/upgrade b/scripts/upgrade
index 38d85ea..edff694 100644
--- a/scripts/upgrade
+++ b/scripts/upgrade
@@ -169,13 +169,20 @@ then
ynh_script_progression --message="Upgrading source files..." --weight=14
# Download Mastodon
- mv "$final_path/live" "$final_path/live_back"
+ tmpdir="$(mktemp -d)"
+
+ mkdir $tmpdir/system
+ if [ -d "$final_path/live/public/system" ]; then
+ rsync -a "$final_path/live/public/system" "$tmpdir/."
+ fi
+ rsync -a "$final_path/live/.env.production" "$tmpdir/."
+ ynh_secure_remove --file="$final_path/live/"
ynh_setup_source --dest_dir="$final_path/live"
- if [ -d "$final_path/live_back/public/system" ]; then
- rsync -a "$final_path/live_back/public/system" "$final_path/live/public/."
+ if [ -d "$tmpdir/system" ]; then
+ rsync -a "$tmpdir/system" "$final_path/live/public/."
fi
- rsync -a "$final_path/live_back/.env.production" "$final_path/live/."
- ynh_secure_remove --file="$final_path/live_back/"
+ rsync -a "$tmpdir/.env.production" "$final_path/live/."
+ ynh_secure_remove --file="$tmpdir/"
# Clean files which are not needed anymore
ynh_secure_remove --file="$final_path/live/config/initializers/timeout.rb"