mirror of
https://github.com/YunoHost-Apps/paheko_ynh.git
synced 2024-09-03 19:56:22 +02:00
better method for upgrade
This commit is contained in:
parent
7a3af8d6a9
commit
96ddeb53d5
1 changed files with 5 additions and 4 deletions
|
@ -33,7 +33,8 @@ fi
|
|||
# BACKUP SQLITE DATABASE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Backup of the DB in temporary file...." --weight=5
|
||||
cp -a $install_dir/data/association.sqlite /tmp/
|
||||
|
||||
cp -R $install_dir/data /tmp/data
|
||||
|
||||
#=================================================
|
||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||
|
@ -44,7 +45,7 @@ then
|
|||
ynh_script_progression --message="Upgrading source files..." --weight=5
|
||||
|
||||
# Download, check integrity, uncompress and patch the source from app.src
|
||||
ynh_setup_source --dest_dir="$install_dir" --keep="association.sqlite data skel-dist config.local.user.php" --full_replace=1
|
||||
ynh_setup_source --dest_dir="$install_dir" --keep="data config.local.user.php" --full_replace=1
|
||||
fi
|
||||
|
||||
chmod -R o-rwx "$install_dir"
|
||||
|
@ -86,7 +87,7 @@ ynh_add_config --template="config.local.php" --destination="$install_dir/config.
|
|||
ynh_add_config --template="config.local.yunohost.php" --destination="$install_dir/config.local.yunohost.php"
|
||||
|
||||
# Restore the sqlite DB
|
||||
mv /tmp/association.sqlite $install_dir/data
|
||||
rsync -a /tmp/data/ $install_dir/data/
|
||||
|
||||
# Permissions on files and directories
|
||||
chmod -R o-rwx "$install_dir"
|
||||
|
@ -113,6 +114,6 @@ sleep 5
|
|||
# END OF SCRIPT
|
||||
#=================================================
|
||||
# remove directory duplicated
|
||||
ynh_secure_remove --file="$install_dir/data/data"
|
||||
ynh_secure_remove --file="tmp/data"
|
||||
|
||||
ynh_script_progression --message="Upgrade of $app completed" --last
|
||||
|
|
Loading…
Add table
Reference in a new issue