Skip to content

Commit

Permalink
Merge pull request #101 from facebook/packages-root-param
Browse files Browse the repository at this point in the history
Add packages-root as a cli option
  • Loading branch information
shayne committed Jul 7, 2016
2 parents d8059ad + 83758b5 commit ab8a8fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ commander.usage("[command] [flags]");
commander.option("--json", "");
commander.option("--modules-folder [path]", "rather than installing modules into the node_modules " +
"folder relative to the cwd, output them here");

commander.option("--packages-root [path]", "rather than storing modules into a global packages root," +
"store them here");
// get command name
let commandName = args.splice(2, 1)[0] || "";

Expand Down Expand Up @@ -77,7 +78,8 @@ reporter.initPeakMemoryCounter();

//
let config = new Config(reporter, {
modulesFolder: commander.modulesFolder
modulesFolder: commander.modulesFolder,
packagesRoot: commander.packagesRoot,
});

// print header
Expand Down
4 changes: 3 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ export default class Config {
this.cwd = opts.cwd;
}

this.packagesRoot = await this.getPackageRoot(opts);
if (!this.packagesRoot) {
this.packagesRoot = await this.getPackageRoot(opts);
}

if (!this.tempFolder) {
this.tempFolder = await this.getTempFolder();
Expand Down

0 comments on commit ab8a8fe

Please sign in to comment.