From 2116825ab9416f81a70f3eaaa14d29b23fb05f26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Sun, 12 Mar 2023 11:26:48 +0100 Subject: [PATCH] Fix --- scripts/_common.sh | 1 + scripts/upgrade | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index 05b2ccf..e19e0bb 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -8,6 +8,7 @@ # nodejs version nodejs_version=16 +version_commit=442f5406ec26d001798c1a2b5a5d9a05fdc77459 #================================================= # PERSONAL HELPERS diff --git a/scripts/upgrade b/scripts/upgrade index 8d751be..c632857 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -21,13 +21,18 @@ upgrade_type=$(ynh_check_app_version_changed) if [ "$upgrade_type" == "UPGRADE_APP" ] then - ynh_script_progression --message="Upgrading source files..." --weight=1 + 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" + pushd $install_dir + chown -R $app:www-data "$install_dir" + git config --system --add safe.directory $install_dir + + ynh_exec_as $app git fetch + ynh_exec_as $app git reset --hard --quiet $version_commit + ynh_exec_as $app git pull + popd fi -chmod 750 "$install_dir" chmod -R o-rwx "$install_dir" chown -R $app:www-data "$install_dir"