From 9a5347b8ef329d27bb5383e73618e727dd1e9e8d Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Sun, 26 Nov 2023 12:55:38 +0100 Subject: [PATCH] admin: Don't consider non-git directory as Fatal --- admin/main.go | 2 +- admin/sync/importer_gitbin.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/admin/main.go b/admin/main.go index e6a8ea6e..8f499c4b 100644 --- a/admin/main.go +++ b/admin/main.go @@ -147,7 +147,7 @@ func main() { } if sync.GlobalImporter != nil { if err := sync.GlobalImporter.Init(); err != nil { - log.Fatal("Unable to initialize the importer:", err) + log.Fatal("Unable to initialize the importer: ", err.Error()) } log.Println("Using", sync.GlobalImporter.Kind()) diff --git a/admin/sync/importer_gitbin.go b/admin/sync/importer_gitbin.go index a1594230..003af57b 100644 --- a/admin/sync/importer_gitbin.go +++ b/admin/sync/importer_gitbin.go @@ -82,7 +82,8 @@ func (i GitImporter) Init() error { } log.Println("Local git repository successfully cloned") } else if _, err := os.Stat(path.Join(i.li.Base, ".git")); errors.Is(err, os.ErrNotExist) { - log.Fatal(i.li.Base, " is not a valid git repository and it cannot be initialized because it's not empty.") + log.Println("[ERR] ", i.li.Base, " is not a valid git repository and it cannot be initialized because it's not empty.") + return nil } // Check if the .git directory exists, change the origin remote to our