File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
packages/cli/src/commands/init Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,9 @@ import init from './init';
33export default {
44 func : init ,
55 detached : true ,
6- name : 'init < projectName> ' ,
6+ name : 'init [ projectName] ' ,
77 description :
8- 'Initialize a new React Native project named <projectName> in a directory of the same name.' ,
8+ 'Initialize a new React Native project in a directory of the same name.' ,
99 options : [
1010 {
1111 name : '--version <string>' ,
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import TemplateAndVersionError from './errors/TemplateAndVersionError';
2424import { getBunVersionIfAvailable } from '../../tools/bun' ;
2525import { getNpmVersionIfAvailable } from '../../tools/npm' ;
2626import { getYarnVersionIfAvailable } from '../../tools/yarn' ;
27+ import prompts from 'prompts' ;
2728
2829const DEFAULT_VERSION = 'latest' ;
2930
@@ -274,6 +275,15 @@ export default (async function initialize(
274275 [ projectName ] : Array < string > ,
275276 options : Options ,
276277) {
278+ if ( ! projectName ) {
279+ const { projName} = await prompts ( {
280+ type : 'text' ,
281+ name : 'projName' ,
282+ message : 'What is the project name?' ,
283+ } ) ;
284+ projectName = projName ;
285+ }
286+
277287 validateProjectName ( projectName ) ;
278288
279289 if ( ! ! options . template && ! ! options . version ) {
You can’t perform that action at this time.
0 commit comments