From 9ef377a0ade3d57171b2e7016be0aa9e4c05193c Mon Sep 17 00:00:00 2001 From: Bruce Johnson Date: Mon, 15 Feb 2021 16:03:11 -0800 Subject: [PATCH 1/2] Fix issue #11320. WindowsLikeFilesystem true when release string includes case insensitive word microsoft. --- tools/static-assets/server/mini-files.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/static-assets/server/mini-files.ts b/tools/static-assets/server/mini-files.ts index 39684b361f..14629a970f 100644 --- a/tools/static-assets/server/mini-files.ts +++ b/tools/static-assets/server/mini-files.ts @@ -14,7 +14,7 @@ import { release, EOL } from "os"; // (Windows Subsystem for Linux) even if it otherwise looks like we're on Unix. // https://github.com/Microsoft/BashOnWindows/issues/423#issuecomment-221627364 export function isWindowsLikeFilesystem() { - return process.platform === "win32" || release().indexOf("Microsoft") >= 0; + return process.platform === "win32" || release().toLowerCase().indexOf("microsoft") >= 0; } export function toPosixPath(p: string, partialPath: boolean = false) { From 85da5b418671fd69be4899b31c0e01ec95698efa Mon Sep 17 00:00:00 2001 From: Bruce Johnson Date: Thu, 18 Feb 2021 14:13:54 -0800 Subject: [PATCH 2/2] use includes instead of indexOf --- tools/static-assets/server/mini-files.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/static-assets/server/mini-files.ts b/tools/static-assets/server/mini-files.ts index 14629a970f..e0bc0ab9fb 100644 --- a/tools/static-assets/server/mini-files.ts +++ b/tools/static-assets/server/mini-files.ts @@ -14,7 +14,7 @@ import { release, EOL } from "os"; // (Windows Subsystem for Linux) even if it otherwise looks like we're on Unix. // https://github.com/Microsoft/BashOnWindows/issues/423#issuecomment-221627364 export function isWindowsLikeFilesystem() { - return process.platform === "win32" || release().toLowerCase().indexOf("microsoft") >= 0; + return process.platform === "win32" || release().toLowerCase().includes("microsoft"); } export function toPosixPath(p: string, partialPath: boolean = false) {