Respect projectName on template creation

This commit is contained in:
jmhdez 2015-09-15 12:47:59 +02:00
parent 4fd0a2de0d
commit 575e9b7b9a
2 changed files with 3 additions and 3 deletions

View File

@ -3,11 +3,10 @@
var path = require('path');
var yeoman = require('yeoman-environment');
function init(projectDir, appName) {
function init(projectDir, args) {
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 = process.argv.slice(3);
var generator = env.create('react:app', {args: args});
generator.destinationRoot(projectDir);
generator.run();

View File

@ -144,8 +144,9 @@ function createProject(name) {
process.exit(1);
}
var args = [projectName].concat(process.argv.slice(4));
cli = require(CLI_MODULE_PATH());
cli.init(root, projectName);
cli.init(root, args);
});
}