mirror of
https://github.com/status-im/react-native.git
synced 2025-01-23 16:00:37 +00:00
24d2bbfbab
Reviewed By: cpojer Differential Revision: D4166993 fbshipit-source-id: 9a8249175d98b42d7557817846d8c09c9769485e
32 lines
1006 B
JavaScript
32 lines
1006 B
JavaScript
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
'use strict';
|
|
|
|
var path = require('path');
|
|
var yeoman = require('yeoman-environment');
|
|
|
|
/**
|
|
* Simple utility for running the android yeoman generator.
|
|
*
|
|
* @param {String} projectDir root project directory (i.e. contains index.js)
|
|
* @param {String} name name of the root JS module for this app
|
|
*/
|
|
module.exports = function(projectDir, name) {
|
|
var oldCwd = process.cwd();
|
|
process.chdir(projectDir);
|
|
|
|
var env = yeoman.createEnv();
|
|
var generatorPath = path.join(__dirname, 'generator');
|
|
env.register(generatorPath, 'react:app');
|
|
var args = ['react:app', name].concat(process.argv.slice(4));
|
|
env.run(args, {'skip-ios': true}, function() {
|
|
process.chdir(oldCwd);
|
|
});
|
|
};
|