8000 Allow `new projet --webapp --no-git` · symfony-cli/symfony-cli@6b29ebc · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b29ebc

Browse files
committed
Allow new projet --webapp --no-git
Fix #498
1 parent bf40c88 commit 6b29ebc

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

commands/local_new.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,16 +137,16 @@ var localNewCmd = &console.Command{
137137
if symfonyVersion != "" && c.Bool("demo") {
138138
return console.Exit("The --version flag is not supported for the Symfony Demo", 1)
139139
}
140-
if c.Bool("webapp") && c.Bool("no-git") {
141-
return console.Exit("The --webapp flag cannot be used with --no-git", 1)
142-
}
143140
if c.Bool("webapp") && c.Bool("api") {
144141
return console.Exit("The --api flag cannot be used with --webapp", 1)
145142
}
146143
withCloud := c.Bool("cloud") || c.Bool("upsun")
147144
if len(c.StringSlice("service")) > 0 && !withCloud {
148145
return console.Exit("The --service flag cannot be used without --cloud or --upsun", 1)
149146
}
147+
if withCloud && c.Bool("no-git") {
148+
return console.Exit("The --no-git flag cannot be used with --cloud or --upsun", 1)
149+
}
150150

151151
s := terminal.NewSpinner(terminal.Stderr)
152152
s.Start()
@@ -178,11 +178,12 @@ var localNewCmd = &console.Command{
178178
if c.Bool("webapp") {
179179
if err := runComposer(c, dir, []string{"require", "webapp"}, c.Bool("debug")); err != nil {
180180
return err
181-
}
182-
buf, err := git.AddAndCommit(dir, []string{"."}, "Add webapp packages", c.Bool("debug"))
183-
if err != nil {
184-
fmt.Print(buf.String())
185-
return err
181+
} else if !c.Bool("no-git") {
182+
buf, err := git.AddAndCommit(dir, []string{"."}, "Add webapp packages", c.Bool("debug"))
183+
if err != nil {
184+
fmt.Print(buf.String())
185+
return err
186+
}
186187
}
187188
}
188189

0 commit comments

Comments
 (0)
0