Fix duplicate matching and windowsExecutableExtensions setting

Fixes #238285
This commit is contained in:
Daniel Imms
2025-01-20 03:45:21 -08:00
parent 61760c4641
commit 09e49a5252
2 changed files with 5 additions and 5 deletions

View File

@@ -6,7 +6,7 @@
import { osIsWindows } from './os';
import * as fs from 'fs/promises';
export async function isExecutable(filePath: string, configuredWindowsExecutableExtensions?: { [key: string]: boolean | undefined }): Promise<boolean> {
export async function isExecutable(filePath: string, configuredWindowsExecutableExtensions?: { [key: string]: boolean | undefined } | undefined): Promise<boolean> {
if (osIsWindows()) {
const resolvedWindowsExecutableExtensions = resolveWindowsExecutableExtensions(configuredWindowsExecutableExtensions);
return resolvedWindowsExecutableExtensions.find(ext => filePath.endsWith(ext)) !== undefined;