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