[react-packager] Add root to packager rootProjects via cli | Boopathi Rajaa
This commit is contained in:
parent
c88a1cd9b8
commit
8f68996ccd
|
@ -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' +
|
||||
|
|
|
@ -3,4 +3,4 @@
|
|||
ulimit -n 4096
|
||||
|
||||
THIS_DIR=$(dirname "$0")
|
||||
node $THIS_DIR/packager.js
|
||||
node $THIS_DIR/packager.js "$@"
|
||||
|
|
Loading…
Reference in New Issue