admin: Don't consider non-git directory as Fatal

This commit is contained in:
nemunaire 2023-11-26 12:55:38 +01:00
parent 334512ef0d
commit 9a5347b8ef
2 changed files with 3 additions and 2 deletions

View File

@ -147,7 +147,7 @@ func main() {
} }
if sync.GlobalImporter != nil { if sync.GlobalImporter != nil {
if err := sync.GlobalImporter.Init(); err != 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()) log.Println("Using", sync.GlobalImporter.Kind())

View File

@ -82,7 +82,8 @@ func (i GitImporter) Init() error {
} }
log.Println("Local git repository successfully cloned") log.Println("Local git repository successfully cloned")
} else if _, err := os.Stat(path.Join(i.li.Base, ".git")); errors.Is(err, os.ErrNotExist) { } 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 // Check if the .git directory exists, change the origin remote to our