chore: override host platform with env variable
Allow to override host platform with an environment variable. This is for adventurous users that want to run Playwright on unsupported linux distributions. This way we do not need to hard code
This commit is contained in:
parent
ab22f81922
commit
76f16b29db
|
|
@ -35,6 +35,12 @@ export type HostPlatform = 'win64' |
|
||||||
'<unknown>';
|
'<unknown>';
|
||||||
|
|
||||||
function calculatePlatform(): { hostPlatform: HostPlatform, isOfficiallySupportedPlatform: boolean } {
|
function calculatePlatform(): { hostPlatform: HostPlatform, isOfficiallySupportedPlatform: boolean } {
|
||||||
|
if (process.env.PLAYWRIGHT_HOST_PLATFORM_OVERRIDE) {
|
||||||
|
return {
|
||||||
|
hostPlatform: process.env.PLAYWRIGHT_HOST_PLATFORM_OVERRIDE as HostPlatform,
|
||||||
|
isOfficiallySupportedPlatform: false
|
||||||
|
};
|
||||||
|
}
|
||||||
const platform = os.platform();
|
const platform = os.platform();
|
||||||
if (platform === 'darwin') {
|
if (platform === 'darwin') {
|
||||||
const ver = os.release().split('.').map((a: string) => parseInt(a, 10));
|
const ver = os.release().split('.').map((a: string) => parseInt(a, 10));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue