File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments