From 9964a96bfd5c05725b99fee0f1c52861ebabe117 Mon Sep 17 00:00:00 2001 From: Safeer Jiwan Date: Fri, 21 Jun 2024 15:02:43 -0700 Subject: [PATCH] fix: don't fail `ftl new` if there's no git repo (#1859) Fixes #1848 --- cmd/ftl/cmd_new.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/ftl/cmd_new.go b/cmd/ftl/cmd_new.go index 75596ef4ad..831364a03c 100644 --- a/cmd/ftl/cmd_new.go +++ b/cmd/ftl/cmd_new.go @@ -67,8 +67,9 @@ func (i newGoCmd) Run(ctx context.Context) error { return err } - logger.Debugf("Adding files to git") - if !config.NoGit { + _, ok := internal.GitRoot(i.Dir).Get() + if !config.NoGit && ok { + logger.Debugf("Adding files to git") if config.Hermit { if err := maybeGitAdd(ctx, i.Dir, "bin/*"); err != nil { return err