[react-packager] Add root to packager rootProjects via cli | Boopathi Rajaa

This commit is contained in:
Amjad Masad 2015-02-19 11:21:34 -08:00
parent c88a1cd9b8
commit 8f68996ccd
2 changed files with 14 additions and 1 deletions

View File

@ -26,12 +26,25 @@ var parseCommandLine = require('./parseCommandLine.js');
var options = parseCommandLine([{
command: 'port',
default: 8081,
}, {
command: 'root',
description: 'add another root(s) to be used by the packager in this project',
}]);
if (!options.projectRoots) {
options.projectRoots = [path.resolve(__dirname, '..')];
}
if (options.root) {
if (typeof options.root === 'string') {
options.projectRoots.push(path.resolve(options.root));
} else {
options.root.forEach(function(root) {
options.projectRoots.push(path.resolve(root));
});
}
}
console.log('\n' +
' ===============================================================\n' +
' | Running packager on port ' + options.port + '. \n' +

View File

@ -3,4 +3,4 @@
ulimit -n 4096
THIS_DIR=$(dirname "$0")
node $THIS_DIR/packager.js
node $THIS_DIR/packager.js "$@"