@@ -49,13 +49,18 @@ program
49
49
. option ( '-i, --inlinePreset <json>' , 'Skip prompts and use inline JSON string as preset' )
50
50
. option ( '-m, --packageManager <command>' , 'Use specified npm client when installing dependencies' )
51
51
. 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' )
53
53
. option ( '-n, --no-git' , 'Skip git initialization' )
54
54
. option ( '-f, --force' , 'Overwrite target directory if it exists' )
55
55
. option ( '-c, --clone' , 'Use git clone when fetching remote preset' )
56
56
. option ( '-x, --proxy' , 'Use specified proxy when creating project' )
57
57
. 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 )
59
64
} )
60
65
61
66
program
0 commit comments