Skip to content

Commit

Permalink
BI-486 - NpmDriver fails when executed with npm's --verbose flag
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalbe4 committed Jun 2, 2019
1 parent d784cfb commit d6cea80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,9 @@ public String version(File workingDirectory) throws IOException, InterruptedExce
}

public String configList(File workingDirectory, List<String> extraArgs) throws IOException, InterruptedException {
// We're making sure that the --verbose npm option is not included in the options list,
// because it will break the the command output parsing.
// Remove the --verbose option.
List<String> args = new ArrayList<>();
for (String arg : extraArgs) {
if (!"--verbose".equals(arg)) {
args.add(arg);
}
}

// We're adding the -s option to the command, to make sure the command output can be parsed properly.
List<String> args = new ArrayList<>(extraArgs);
args.add("-s");
return runCommand(workingDirectory, new String[]{"c", "ls", "--json"}, args);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ private Object[][] npmInstallProvider() {
{Project.B, Collections.emptySet(), "--production", false},
{Project.C, Project.C.dependencies, "", true},
{Project.C, Project.B.dependencies, "--only=development", false},
{Project.C, Project.A.dependencies, "--only=production", true}
{Project.C, Project.A.dependencies, "--only=production", true},
{Project.C, Project.C.dependencies, "--verbose", true}
};
}

Expand Down

0 comments on commit d6cea80

Please sign in to comment.