fix(deps): check only .dll/.exe files on Windows (#28901)

Fixes https://github.com/microsoft/playwright/issues/28846
This commit is contained in:
Max Schmitt 2024-01-08 21:53:18 +01:00 committed by GitHub
parent 0f3bd9835f
commit feece0f569
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,7 +55,11 @@ export function readDockerVersionSync(): null | { driverVersion: string, dockerI
}
}
const checkExecutable = (filePath: string) => fs.promises.access(filePath, fs.constants.X_OK).then(() => true).catch(e => false);
const checkExecutable = (filePath: string) => {
if (process.platform === 'win32')
return filePath.endsWith('.exe');
return fs.promises.access(filePath, fs.constants.X_OK).then(() => true).catch(() => false);
};
function isSupportedWindowsVersion(): boolean {
if (os.platform() !== 'win32' || os.arch() !== 'x64')