From 325de5c0f6aef77a96d16d59651aae7d2bd134ad Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Fri, 6 Aug 2021 21:00:06 +0200 Subject: [PATCH] Fix --- scripts/_common.sh | 3 +-- scripts/install | 8 ++++++-- scripts/upgrade | 11 ++++++----- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/scripts/_common.sh b/scripts/_common.sh index b9bfcbe..6726bba 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,8 +4,7 @@ # COMMON VARIABLES #================================================= -# dependencies used by the app -pkg_dependencies="" +version_commit="5262518699e86852feb3967f65d1dc6376c3d069" nodejs_version=12 diff --git a/scripts/install b/scripts/install index 023c911..42c8e5d 100644 --- a/scripts/install +++ b/scripts/install @@ -84,9 +84,13 @@ ynh_script_progression --message="Setting up source files..." --weight=2 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -ynh_setup_source --dest_dir=$final_path +#ynh_setup_source --dest_dir=$final_path -#git clone https://github.com/Awesome-Technologies/synapse-admin.git "$final_path" --quiet +git clone --quiet https://github.com/Awesome-Technologies/synapse-admin.git -b master "$final_path" +# Reset branch to the level of update we needed +pushd "$final_path" + git reset --hard --quiet $version_commit +popd chmod 750 "$final_path" chmod -R o-rwx "$final_path" diff --git a/scripts/upgrade b/scripts/upgrade index 4994f75..6782b45 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -79,11 +79,12 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=160 - # Remove the app directory securely - ynh_secure_remove --file=$final_path - - # Download, check integrity, uncompress and patch the source from app.src - ynh_setup_source --dest_dir=$final_path + pushd "$final_path" + git fetch --quiet + git checkout stable --quiet + git pull --quiet + git reset --hard $version_commit --quiet + popd fi chmod 750 "$final_path"