@@ -49,13 +49,18 @@ program
4949 . option ( '-i, --inlinePreset <json>' , 'Skip prompts and use inline JSON string as preset' )
5050 . option ( '-m, --packageManager <command>' , 'Use specified npm client when installing dependencies' )
5151 . option ( '-r, --registry <url>' , 'Use specified npm registry when installing dependencies (only for npm)' )
52- . option ( '-g, --git [message]' , 'Force git initialization with optional initial commit message' )
52+ . option ( '-g, --git [message]' , 'Force git initialization with initial commit message' )
5353 . option ( '-n, --no-git' , 'Skip git initialization' )
5454 . option ( '-f, --force' , 'Overwrite target directory if it exists' )
5555 . option ( '-c, --clone' , 'Use git clone when fetching remote preset' )
5656 . option ( '-x, --proxy' , 'Use specified proxy when creating project' )
5757 . action ( ( name , cmd ) => {
58- require ( '../lib/create' ) ( name , cleanArgs ( cmd ) )
58+ const options = cleanArgs ( cmd )
59+ // --no-git makes commander to default git to true
60+ if ( process . argv . includes ( '-g' ) || process . argv . includes ( '--git' ) ) {
61+ options . forceGit = true
62+ }
63+ require ( '../lib/create' ) ( name , options )
5964 } )
6065
6166program
0 commit comments