1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/gogs_ynh.git synced 2024-09-03 20:36:23 +02:00

Update upgrade

This commit is contained in:
ericgaspar 2021-12-22 12:03:31 +01:00
parent 788dec2a6a
commit fbfb76b42b
No known key found for this signature in database
GPG key ID: 574F281483054D44

View file

@ -55,6 +55,20 @@ ynh_abort_if_errors
#=================================================
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
# If new datadir doesn't exist, create it
if [ -z "/home/yunohost.app/$app" ]; then
datadir=/home/yunohost.app/$app
ynh_app_setting_set --app=$app --key=datadir --value=$datadir
cp -a "/home/$app/repositories" "$datadir/data/repositories"
cp -a "/home/$app/data/avatars" "$datadir/data/avatars"
cp -a "/home/$app/data/attachments" "$datadir/data/attachments"
chmod 750 "$datadir"
chmod -R o-rwx "$datadir"
chown -R $app:www-data "$datadir"
fi
# Cleaning legacy permissions
if ynh_legacy_permissions_exists; then
ynh_legacy_permissions_delete_all