Skip to content

Commit

Permalink
Short-circuit out of install with no packages (#569)
Browse files Browse the repository at this point in the history
The degenerate case of `NpmUtilities.installInDir` is an install of no
packages.  The _behavior_ in this case was previously to run an `npm install`
with no arguments, which installs _everything_.

This patch short-circuits out of the noop.
  • Loading branch information
gigabo authored and hzoo committed Feb 3, 2017
1 parent 20d9ee8 commit 124df44
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/NpmUtilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import semver from "semver";
export default class NpmUtilities {
@logger.logifyAsync()
static installInDir(directory, dependencies, callback) {

// Nothing to do if we weren't given any deps.
if (!(dependencies && dependencies.length)) return callback();

let args = ["install"];

if (dependencies) {
Expand Down

0 comments on commit 124df44

Please sign in to comment.