Skip to content

Commit

Permalink
[react-packager] Add root to packager rootProjects via cli | Boopathi…
Browse files Browse the repository at this point in the history
… Rajaa
  • Loading branch information
amasad committed Feb 19, 2015
1 parent c88a1cd commit 8f68996
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions packager/packager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' +
Expand Down
2 changes: 1 addition & 1 deletion packager/packager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
ulimit -n 4096

THIS_DIR=$(dirname "$0")
node $THIS_DIR/packager.js
node $THIS_DIR/packager.js "$@"

0 comments on commit 8f68996

Please sign in to comment.