Skip to content

Commit 00a18a8

Browse files
authored
fix: fix incorrect pathEnv() implementation in JavaScriptProvider subclass (#133)
## Description fix: fix incorrect pathEnv() implementation in JavaScriptProvider subclass see more info in the bug report #132 **Related issue (if any):** fixes #132 ## Checklist - [x] I have followed this repository's contributing guidelines. - [x] I will adhere to the project's code of conduct. ## Additional information > Anything else? Signed-off-by: Chao Wang <chaowan@redhat.com>
1 parent 92b652b commit 00a18a8

4 files changed

Lines changed: 4 additions & 19 deletions

File tree

src/main/java/com/redhat/exhort/providers/JavaScriptNpmProvider.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public final class JavaScriptNpmProvider extends JavaScriptProvider {
2626

2727
public static final String LOCK_FILE = "package-lock.json";
2828
public static final String CMD_NAME = "npm";
29-
public static final String ENV_NODE_HOME = "NODE_HOME";
3029

3130
public JavaScriptNpmProvider(Path manifest) {
3231
super(manifest, Ecosystem.Type.NPM, CMD_NAME);
@@ -37,11 +36,6 @@ protected final String lockFileName() {
3736
return LOCK_FILE;
3837
}
3938

40-
@Override
41-
protected String pathEnv() {
42-
return ENV_NODE_HOME;
43-
}
44-
4539
@Override
4640
protected String[] updateLockFileCmd(Path manifestDir) {
4741
return new String[] {

src/main/java/com/redhat/exhort/providers/JavaScriptPnpmProvider.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public final class JavaScriptPnpmProvider extends JavaScriptProvider {
2929

3030
public static final String LOCK_FILE = "pnpm-lock.yaml";
3131
public static final String CMD_NAME = "pnpm";
32-
public static final String ENV_PNPM_HOME = "PNPM_HOME";
3332

3433
public JavaScriptPnpmProvider(Path manifest) {
3534
super(manifest, Ecosystem.Type.PNPM, CMD_NAME);
@@ -40,11 +39,6 @@ protected final String lockFileName() {
4039
return LOCK_FILE;
4140
}
4241

43-
@Override
44-
protected String pathEnv() {
45-
return ENV_PNPM_HOME;
46-
}
47-
4842
@Override
4943
protected String[] updateLockFileCmd(Path manifestDir) {
5044
return new String[] {

src/main/java/com/redhat/exhort/providers/JavaScriptProvider.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
*/
5151
public abstract class JavaScriptProvider extends Provider {
5252

53+
public static final String ENV_NODE_HOME = "NODE_HOME";
5354
private static final String PROP_PATH = "PATH";
5455

5556
private System.Logger log = System.getLogger(this.getClass().getName());
@@ -73,7 +74,9 @@ protected final String packageManager() {
7374

7475
protected abstract String lockFileName();
7576

76-
protected abstract String pathEnv();
77+
protected String pathEnv() {
78+
return ENV_NODE_HOME;
79+
}
7780

7881
protected abstract String[] updateLockFileCmd(Path manifestDir);
7982

src/main/java/com/redhat/exhort/providers/JavaScriptYarnProvider.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public final class JavaScriptYarnProvider extends JavaScriptProvider {
3434

3535
public static final String LOCK_FILE = "yarn.lock";
3636
public static final String CMD_NAME = "yarn";
37-
public static final String ENV_YARN_HOME = "YARN_HOME";
3837

3938
private static final Pattern versionPattern = Pattern.compile("^([0-9]+)\\.");
4039

@@ -50,11 +49,6 @@ protected final String lockFileName() {
5049
return LOCK_FILE;
5150
}
5251

53-
@Override
54-
protected String pathEnv() {
55-
return ENV_YARN_HOME;
56-
}
57-
5852
@Override
5953
protected String[] updateLockFileCmd(Path manifestDir) {
6054
return processor.installCmd(manifestDir);

0 commit comments

Comments
 (0)