diff --git a/local-cli/init.js b/local-cli/init.js index fe99f0177..dfcc3edf8 100755 --- a/local-cli/init.js +++ b/local-cli/init.js @@ -2,6 +2,15 @@ var path = require('path'); var yeoman = require('yeoman-environment'); +var TerminalAdapter = require('yeoman-environment/lib/adapter.js'); + +class CreateSuppressingTerminalAdapter extends TerminalAdapter { + constructor() { + super(); + // suppres 'create' output generated by yeoman + this.log.create = function() {}; + } +}; // argsOrName can be: // - A string (e.g. 'AwesomeApp'). This is the common case when @@ -10,7 +19,7 @@ var yeoman = require('yeoman-environment'); // need to pass custom arguments to the generator. function init(projectDir, argsOrName) { console.log('Setting up new React Native app in ' + projectDir); - var env = yeoman.createEnv(); + var env = yeoman.createEnv(undefined, undefined, new CreateSuppressingTerminalAdapter()); env.register(require.resolve(path.join(__dirname, 'generator')), 'react:app'); // argv is e.g. // ['node', 'react-native', 'init', 'AwesomeApp', '--verbose']