mirror of
https://github.com/YunoHost-Apps/veloren_ynh.git
synced 2024-09-03 17:46:10 +02:00
fix upgrade
This commit is contained in:
parent
8cd6c8b0b4
commit
0595fdf24b
2 changed files with 13 additions and 2 deletions
|
@ -98,7 +98,7 @@ function compile_server {
|
|||
ynh_secure_remove --file="$final_path/.cargo"
|
||||
ynh_secure_remove --file="$final_path/.rustup"
|
||||
|
||||
ynh_exec_as $app ln -sf "$final_path/assets" "$data_path/assets"
|
||||
ynh_exec_as $app ln -sf "$final_path/live/assets" "$data_path/assets"
|
||||
|
||||
set_permissions
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ get_app_settings
|
|||
#=================================================
|
||||
# CHECK VERSION
|
||||
#=================================================
|
||||
ynh_script_progression --message="Checking version..."
|
||||
|
||||
upgrade_type=$(ynh_check_app_version_changed)
|
||||
|
||||
|
@ -30,7 +31,7 @@ upgrade_type=$(ynh_check_app_version_changed)
|
|||
ynh_script_progression --message="Backing up the app before upgrading (may take a while)..." --weight=10
|
||||
|
||||
# Backup the current version of the app
|
||||
ynh_backup_before_upgrade
|
||||
#ynh_backup_before_upgrade
|
||||
ynh_clean_setup () {
|
||||
ynh_clean_check_starting
|
||||
# Restore it if the upgrade fails
|
||||
|
@ -53,6 +54,16 @@ ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app
|
|||
#=================================================
|
||||
ynh_script_progression --message="Ensuring downward compatibility..."
|
||||
|
||||
if [ ! -d "$final_path/live" ]
|
||||
then
|
||||
tempdir=/opt/yunohost/$(ynh_string_random --length=8)
|
||||
mkdir -p $tempdir
|
||||
mv $final_path/ $tempdir/
|
||||
mkdir -p $final_path
|
||||
mv $tempdir/$app $final_path/live/
|
||||
ynh_secure_remove --file="$tempdir"
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# CREATE DEDICATED USER
|
||||
#=================================================
|
||||
|
|
Loading…
Add table
Reference in a new issue