Skip to content

Commit

Permalink
fix: properly invoke isWsl as a function (#22)
Browse files Browse the repository at this point in the history
* fix: properly invoke isWsl as a function

Hopefully fixes nuxt/framework#4495

* fix: typo
  • Loading branch information
Aareksio committed Apr 25, 2022
1 parent 7ede235 commit 2951376
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/open/index.ts
Expand Up @@ -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`

Expand All @@ -137,7 +137,7 @@ const baseOpen = async (options) => {
'-EncodedCommand'
)

if (!isWsl) {
if (!isWsl()) {
childProcessOptions.windowsVerbatimArguments = true
}

Expand Down Expand Up @@ -275,7 +275,7 @@ function detectArchBinary (binary) {
}

function detectPlatformBinary ({ [platform]: platformBinary }, { wsl }) {
if (wsl && isWsl) {
if (wsl && isWsl()) {
return detectArchBinary(wsl)
}

Expand Down Expand Up @@ -358,7 +358,7 @@ function _isWsl () {
let isWSLCached
function isWsl () {
if (isWSLCached === undefined) {
isDockerCached = _isWsl()
isWSLCached = _isWsl()
}
return isWSLCached
}
Expand Down

0 comments on commit 2951376

Please sign in to comment.