Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: properly invoke isWsl as a function #22

Merged
merged 2 commits into from
Apr 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lib/open/index.ts
Original file line number Diff line number Diff line change
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