Added react-native new-library command

This commit is contained in:
Joe Stanton
2015-03-28 15:50:31 +00:00
parent b2d1d6f3e9
commit 396439bf86
11 changed files with 427 additions and 39 deletions

View File

@@ -7,6 +7,7 @@
var fs = require('fs');
var path = require('path');
var spawn = require('child_process').spawn;
var utils = require('../local-cli/generator-utils');
var CLI_MODULE_PATH = function() {
return path.resolve(
@@ -56,14 +57,7 @@ if (cli) {
}
function init(name) {
if (!name.match(/^[$A-Z_][0-9A-Z_$]*$/i)) {
console.error(
'"%s" is not a valid name for a project. Please use a valid identifier ' +
'name (alphanumeric).',
name
);
process.exit(1);
}
utils.validatePackageName(name);
var root = path.resolve(name);
var projectName = path.basename(root);