Skip to content

Commit

Permalink
added windows check string
Browse files Browse the repository at this point in the history
Signed-off-by: msivasubramaniaan <[email protected]>
  • Loading branch information
msivasubramaniaan authored and datho7561 committed Nov 6, 2023
1 parent ef2b50e commit 9538f7f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ export class ToolsConfig {

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

0 comments on commit 9538f7f

Please sign in to comment.