File tree Expand file tree Collapse file tree 2 files changed +13
-469
lines changed
packages/create-react-app Expand file tree Collapse file tree 2 files changed +13
-469
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ const errorLogFilePatterns = [
61
61
] ;
62
62
63
63
let projectName ;
64
+ let multipleProjectNameArgs = false ;
64
65
const args = process . argv . slice ( 2 ) ;
65
66
66
67
const program = new commander . Command ( packageJson . name )
@@ -85,17 +86,7 @@ const program = new commander.Command(packageJson.name)
85
86
} ) ;
86
87
87
88
if ( argsLength > 1 ) {
88
-
89
- console . log (
90
- chalk . yellow (
91
- `\n You have provided more that one argument for <project-directory>.`
92
- )
93
- ) ;
94
-
95
- console . log (
96
- `\n Run ${ chalk . cyan ( `create-react-app --help` ) } to see all options.`
97
- ) ;
98
- process . exit ( 1 ) ;
89
+ multipleProjectNameArgs = true ;
99
90
}
100
91
} )
101
92
. option ( '--verbose' , 'print additional logs' )
@@ -172,8 +163,17 @@ if (program.info) {
172
163
. then ( console . log ) ;
173
164
}
174
165
175
- if ( typeof projectName === 'undefined' ) {
176
- console . error ( 'Please specify the project directory:' ) ;
166
+ if ( typeof projectName === 'undefined' || multipleProjectNameArgs ) {
167
+
168
+ if ( multipleProjectNameArgs ) {
169
+ console . log (
170
+ chalk . yellow (
171
+ `\n You have provided more that one argument for <project-directory>.`
172
+ )
173
+ ) ;
174
+ } else {
175
+ console . error ( 'Please specify the project directory:' ) ;
176
+ }
177
177
console . log (
178
178
` ${ chalk . cyan ( program . name ( ) ) } ${ chalk . green ( '<project-directory>' ) } `
179
179
) ;
You can’t perform that action at this time.
0 commit comments