react-native/local-cli/generate-android.js
Martin Konicek 42eb5464fd Release React Native for Android
This is an early release and there are several things that are known
not to work if you're porting your iOS app to Android.

See the Known Issues guide on the website.

We will work with the community to reach platform parity with iOS.
2015-09-14 18:13:39 +01:00

25 lines
721 B
JavaScript

'use strict';
var fs = require('fs');
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);
});
};