1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/garradin_ynh.git synced 2024-09-03 18:36:17 +02:00

add some new directories in the releases to keep datas on upgrade

This commit is contained in:
Robles Rodolphe 2021-12-28 10:21:55 +01:00
parent fe30b33108
commit ce4fccfd27

View file

@ -66,6 +66,8 @@ ynh_script_progression --message="Backing up the data before upgrading (may take
bdd=$final_path/association.sqlite
squelettes=$final_path/www/squelettes
data=$final_path/data
skel_dist=$final_path/www/skel-dist
if [ -d "$squelettes" ]; then
cp -ar $squelettes /tmp/squelettes
@ -75,6 +77,14 @@ if [ -e "$bdd" ]; then
cp -a $bdd /tmp/association.sqlite
fi
if [ -d "$data" ]; then
cp -ar $data /tmp/data
fi
if [ -d "$skel_dist" ]; then
cp -ar $skel_dist /tmp/skel-dist
fi
#=================================================
# UPGRADE TO 0.9.8 if necessary
#=================================================
@ -212,6 +222,8 @@ ynh_script_progression --message="restore data..." --weight=10
backup_bdd=/tmp/association.sqlite
backup_squelettes=/tmp/squelettes
backup_data=/tmp/data
backup_skel_dist=/tmp/skel-dist
if [ -d "$backup_squelettes" ]
then
@ -225,6 +237,19 @@ then
ynh_secure_remove $backup_bdd
fi
if [ -d "$backup_data" ]
then
cp -ar $backup_data $final_path/data
ynh_secure_remove $backup_data
fi
if [ -d "$backup_skel_dist" ]
then
cp -ar $backup_skel_dist $final_path/www/skel-dist
ynh_secure_remove $backup_skel_dist
fi
#=================================================
# ADD A CONFIGURATION
#=================================================