Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c9b85ee

Browse files
committed
Fix version check in local:new when cloning the book
1 parent 6f197c3 commit c9b85ee

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

commands/local_new.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,26 +108,26 @@ var localNewCmd = &console.Command{
108108
}
109109
}
110110

111+
symfonyVersion := c.String("version")
112+
111113
if c.Bool("book") {
114+
if symfonyVersion == "" {
115+
return console.Exit("The --version flag is required for the Symfony book", 1)
116+
}
117+
112118
book := &book.Book{
113119
Dir: dir,
114120
Debug: c.Bool("debug"),
115121
Force: false,
116122
AutoConfirm: true,
117123
}
118-
if err := book.Clone(c.String("version")); err != nil {
119-
return err
120-
}
121-
return nil
124+
125+
return book.Clone(symfonyVersion)
122126
}
123127

124-
symfonyVersion := c.String("version")
125128
if symfonyVersion != "" && c.Bool("demo") {
126129
return console.Exit("The --version flag is not supported for the Symfony Demo", 1)
127130
}
128-
if symfonyVersion == "" && c.Bool("book") {
129-
return console.Exit("The --version flag is required for the Symfony book", 1)
130-
}
131131
if c.Bool("webapp") && c.Bool("no-git") {
132132
return console.Exit("The --webapp flag cannot be used with --no-git", 1)
133133
}

0 commit comments

Comments
 (0)