[cli] make init backwards-compatible for real

This commit is contained in:
Nick Simmons 2015-10-07 17:39:22 -04:00
parent 381e2acd18
commit 8d3bbdf8e6
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@ function init(projectDir, argsOrName) {
console.log('Setting up new React Native app in ' + projectDir);
var env = yeoman.createEnv();
env.register(require.resolve(path.join(__dirname, 'generator')), 'react:app');
var args = Array.isArray(argsOrName) ? argsOrName : [argsOrName].concat(process.args.slice(4));
var args = Array.isArray(argsOrName) ? argsOrName : [argsOrName].concat(process.argv.slice(4));
var generator = env.create('react:app', {args: args});
generator.destinationRoot(projectDir);
generator.run();