Skip to content

Add options to get Project Root from command line in packager #64

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ DerivedData
*.xcuserstate

node_modules
npm-debug.log
11 changes: 11 additions & 0 deletions packager/packager.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,21 @@ var parseCommandLine = require('./parseCommandLine.js');
var options = parseCommandLine([{
command: 'port',
default: 8081,
}, {
command: 'root'
}]);

if (!options.projectRoots) {
options.projectRoots = [path.resolve(__dirname, '..')];
if(options.root) {
if('string' === typeof options.root) {
options.projectRoots.push(path.resolve(options.root))
} else {
options.root.forEach(function(root) {
options.projectRoots.push(path.resolve(root));
});
}
}
}

console.log('\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 "$@"