From d3def9ae0bfef793e20152fb8f656df3457a8f2f Mon Sep 17 00:00:00 2001 From: anmol26s Date: Sat, 6 Mar 2021 20:20:42 +0530 Subject: [PATCH] Fixed upgrade from previous commits --- scripts/restore | 7 ------- scripts/upgrade | 12 ++++++++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/scripts/restore b/scripts/restore index f0ecb61..4248aa3 100755 --- a/scripts/restore +++ b/scripts/restore @@ -113,13 +113,6 @@ ynh_script_progression --message="Restoring the cron file..." ynh_restore_file --origin_path="/etc/cron.d/$app" -#================================================= -# RESTORE THE CRON FILE -#================================================= -ynh_script_progression --message="Restoring the cron file..." - -ynh_restore_file --origin_path="/etc/cron.d/$app" - #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 7c7dba4..b32f5b7 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -100,10 +100,14 @@ then ynh_script_progression --message="Upgrading source files..." # Download, check integrity, uncompress and patch the source from app.src - pushd "$final_path" - git fetch - git checkout tags/$version - popd + if [ `cd $final_path && git rev-parse --is-inside-work-tree` ]; then + pushd "$final_path" + git fetch + git checkout tags/$version + popd + else + ynh_setup_source --dest_dir="$final_path" + fi fi ynh_app_setting_set --app=$app --key=version --value=$version