Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,11 @@ protected String lockFileName() {

@Override
protected String[] updateLockFileCmd(Path manifestDir) {
return new String[] {
packageManager(), "i", "--package-lock-only", "--prefix", manifestDir.toString()
};
return new String[] {packageManager(), "i", "--package-lock-only"};
}

@Override
protected String[] listDepsCmd(boolean includeTransitive, Path manifestDir) {
if (manifestDir != null) {
return new String[] {
packageManager(),
"ls",
includeTransitive ? "--all" : "--depth=0",
"--omit=dev",
"--package-lock-only",
"--json",
"--prefix",
manifestDir.toString()
};
}
return new String[] {
packageManager(),
"ls",
Expand Down
13 changes: 3 additions & 10 deletions src/main/java/com/redhat/exhort/providers/JavaScriptProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -222,17 +222,10 @@ protected JsonNode buildDependencyTree(boolean includeTransitive) throws JsonPro
}
var createPackageLock = updateLockFileCmd(manifestDir);
// execute the clean command
Operations.runProcess(createPackageLock, getExecEnv());
String[] allDeps;
Path workDir = null;
if (!manifest.path.getParent().toString().trim().contains(" ")) {
allDeps = listDepsCmd(includeTransitive, manifestDir);
} else {
allDeps = listDepsCmd(includeTransitive, null);
workDir = manifest.path.getParent();
}
Operations.runProcess(manifestDir, createPackageLock, getExecEnv());
String[] allDeps = listDepsCmd(includeTransitive, manifestDir);
// execute the clean command
String output = Operations.runProcessGetOutput(workDir, allDeps, getExecEnvAsArgs());
String output = Operations.runProcessGetOutput(manifestDir, allDeps, getExecEnvAsArgs());
if (debugLoggingIsNeeded()) {
log.info(
String.format("Listed Install Packages in Json : %s %s", System.lineSeparator(), output));
Expand Down
Loading