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

Fix in update script

This commit is contained in:
anmol26s 2018-07-24 00:43:27 +05:30
parent 2c66727718
commit fa069c9c54

View file

@ -41,11 +41,6 @@ if [ -z $db_name ]; then
ynh_app_setting_set $app db_name $db_name
fi
# If final_path doesn't exist, create it
if [ -z $final_path ]; then
final_path=/var/www/$app
ynh_app_setting_set $app final_path $final_path
fi
#=================================================
# BACKUP BEFORE UPGRADE THEN ACTIVE TRAP
@ -77,9 +72,15 @@ path_url=$(ynh_normalize_url_path $path_url)
tmpdir="$(mktemp -d)"
# Backup the content folder to the temp dir
cp -ar "$final_path/content" "$tmpdir"
sudo rm -R "$tmpdir"
# Download, check integrity, uncompress and patch the source from app.src
# Download, uncompress and patch the source
sudo rm -R "$final_path"
# If final_path doesn't exist, create it
if [ -z $final_path ]; then
final_path=/var/www/$app
ynh_app_setting_set $app final_path $final_path
fi
tmpdir1="$(mktemp -d)"
sudo wget -O "$tmpdir1/ghost.zip" "https://ghost.org/zip/ghost-latest.zip"
unzip "$tmpdir1/ghost.zip" -d "$final_path"
@ -87,6 +88,7 @@ sudo rm -R "$tmpdir1/ghost.zip"
# copy content folder back to the final_path
sudo cp -ar "$tmpdir/content" "${final_path}"
sudo rm -R "$tmpdir"
#=================================================
# SPECIFIC SETUP