From 6b29ebc96fd41ba91ca7cd262ac5b69e7a726aa2 Mon Sep 17 00:00:00 2001 From: Tugdual Saunier Date: Fri, 12 Jul 2024 12:07:03 +0200 Subject: [PATCH] Allow `new projet --webapp --no-git` Fix #498 --- commands/local_new.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/commands/local_new.go b/commands/local_new.go index 28856244..114c600b 100644 --- a/commands/local_new.go +++ b/commands/local_new.go @@ -137,9 +137,6 @@ var localNewCmd = &console.Command{ if symfonyVersion != "" && c.Bool("demo") { return console.Exit("The --version flag is not supported for the Symfony Demo", 1) } - if c.Bool("webapp") && c.Bool("no-git") { - return console.Exit("The --webapp flag cannot be used with --no-git", 1) - } if c.Bool("webapp") && c.Bool("api") { return console.Exit("The --api flag cannot be used with --webapp", 1) } @@ -147,6 +144,9 @@ var localNewCmd = &console.Command{ if len(c.StringSlice("service")) > 0 && !withCloud { return console.Exit("The --service flag cannot be used without --cloud or --upsun", 1) } + if withCloud && c.Bool("no-git") { + return console.Exit("The --no-git flag cannot be used with --cloud or --upsun", 1) + } s := terminal.NewSpinner(terminal.Stderr) s.Start() @@ -178,11 +178,12 @@ var localNewCmd = &console.Command{ if c.Bool("webapp") { if err := runComposer(c, dir, []string{"require", "webapp"}, c.Bool("debug")); err != nil { return err - } - buf, err := git.AddAndCommit(dir, []string{"."}, "Add webapp packages", c.Bool("debug")) - if err != nil { - fmt.Print(buf.String()) - return err + } else if !c.Bool("no-git") { + buf, err := git.AddAndCommit(dir, []string{"."}, "Add webapp packages", c.Bool("debug")) + if err != nil { + fmt.Print(buf.String()) + return err + } } }