Skip to content

Commit bc4f200

Browse files
committed
fix: Fixed jenv results not de-duped
1 parent 11bc630 commit bc4f200

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/resources/java/jenv/java-versions-parameter.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ export class JenvAddParameter extends ArrayStatefulParameter<JenvConfig, string>
2626

2727
return i;
2828
}),
29-
from: (output: string[]) => output.map((i) => {
29+
// De-dupe the results for imports.
30+
from: (output: string[]) => [...new Set(output.map((i) => {
3031
if (i.startsWith('/opt/homebrew/Cellar/openjdk@')) {
3132
return i.split('/').at(4)?.split('@').at(1)
3233
}
3334

3435
return i;
35-
}),
36+
}))],
3637
}
3738
}
3839
}
@@ -57,7 +58,7 @@ export class JenvAddParameter extends ArrayStatefulParameter<JenvConfig, string>
5758
return [...versionPaths]
5859
// Re-map the path back to what was provided in the config
5960
.map((v) => {
60-
const matched = params.find((p) => v.includes(p));
61+
const matched = params?.find((p) => v.includes(p));
6162
return matched === undefined
6263
? v
6364
: matched;

0 commit comments

Comments
 (0)