From 295137644b50f8d3a909091f88bdcb232d060157 Mon Sep 17 00:00:00 2001 From: Arkadiusz Sygulski Date: Mon, 25 Apr 2022 11:26:24 +0200 Subject: [PATCH] fix: properly invoke isWsl as a function (#22) * fix: properly invoke isWsl as a function Hopefully fixes nuxt/framework#4495 * fix: typo --- src/lib/open/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/open/index.ts b/src/lib/open/index.ts index 0965635..2e1fdfc 100644 --- a/src/lib/open/index.ts +++ b/src/lib/open/index.ts @@ -125,7 +125,7 @@ const baseOpen = async (options) => { } else if (platform === 'win32' || (isWsl() && !isDocker())) { const mountPoint = await getWslDrivesMountPoint() - command = isWsl + command = isWsl() ? `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` : `${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell` @@ -137,7 +137,7 @@ const baseOpen = async (options) => { '-EncodedCommand' ) - if (!isWsl) { + if (!isWsl()) { childProcessOptions.windowsVerbatimArguments = true } @@ -275,7 +275,7 @@ function detectArchBinary (binary) { } function detectPlatformBinary ({ [platform]: platformBinary }, { wsl }) { - if (wsl && isWsl) { + if (wsl && isWsl()) { return detectArchBinary(wsl) } @@ -358,7 +358,7 @@ function _isWsl () { let isWSLCached function isWsl () { if (isWSLCached === undefined) { - isDockerCached = _isWsl() + isWSLCached = _isWsl() } return isWSLCached }