From 703ed9877d10b24597825f095de71699a2349583 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Thu, 22 Sep 2022 21:36:03 +0200 Subject: [PATCH] Make sure final_path is a git repo --- scripts/install | 1 + scripts/upgrade | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/scripts/install b/scripts/install index 388008d..b57d7b8 100644 --- a/scripts/install +++ b/scripts/install @@ -103,6 +103,7 @@ ynh_setup_source --dest_dir="$final_path" mkdir -p $final_path/ghost/core/content/themes/casper ynh_setup_source --dest_dir="$final_path/ghost/core/content/themes/casper" --source_id="casper" +git init "$final_path" -q chmod 750 "$final_path" chmod -R o-rwx "$final_path" chown -R $app:www-data "$final_path" diff --git a/scripts/upgrade b/scripts/upgrade index d3a2b7c..4c0b937 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -63,6 +63,11 @@ if ynh_legacy_permissions_exists; then ynh_app_setting_delete --app=$app --key=is_public fi +# Make the final_path a git repo if needed +if [ ! -d "$final_path/.git" ]; then + git init "$final_path" -q +fi + #================================================= # STANDARD UPGRADE STEPS #=================================================