Skip to content

Commit 9538f7f

Browse files
msivasubramaniaandatho7561
authored andcommitted
added windows check string
Signed-off-by: msivasubramaniaan <[email protected]>
1 parent ef2b50e commit 9538f7f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/tools.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@ export class ToolsConfig {
9191

9292
public static async selectTool(locations: string[], versionRange: string): Promise<string> {
9393
let result: string;
94+
const funcValue = Platform.OS !== 'win32' ? 'func' : 'func.exe';
9495
// Array.find cannot be used here because of async calls
9596
for (const location of locations) {
9697
// FIXME: see https://github.com/knative/func/issues/2067
9798
// eslint-disable-next-line no-await-in-loop
98-
if (location && (location.endsWith('func') || semver.satisfies(await ToolsConfig.getVersion(location), versionRange))) {
99+
if (location && (location.endsWith(funcValue) || semver.satisfies(await ToolsConfig.getVersion(location), versionRange))) {
99100
result = location;
100101
break;
101102
}

0 commit comments

Comments
 (0)