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 = [
6161] ;
6262
6363let projectName ;
64+ let multipleProjectNameArgs = false ;
6465const args = process . argv . slice ( 2 ) ;
6566
6667const program = new commander . Command ( packageJson . name )
@@ -85,17 +86,7 @@ const program = new commander.Command(packageJson.name)
8586 } ) ;
8687
8788 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 ;
9990 }
10091 } )
10192 . option ( '--verbose' , 'print additional logs' )
@@ -172,8 +163,17 @@ if (program.info) {
172163 . then ( console . log ) ;
173164}
174165
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+ }
177177 console . log (
178178 ` ${ chalk . cyan ( program . name ( ) ) } ${ chalk . green ( '<project-directory>' ) } `
179179 ) ;
You can’t perform that action at this time.
0 commit comments