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 Docker in WSL2 for real #168

Merged
merged 2 commits into from Feb 1, 2020
Merged

Fix Docker in WSL2 for real #168

merged 2 commits into from Feb 1, 2020

Conversation

@pluma
Copy link
Contributor

@pluma pluma commented Jan 30, 2020

The module exports a function, not a boolean, so the check for its value would always pass. This breaks WSL (again). We don't need to call the function more than once to find out if we're in docker, so this just calls it right on require.

Fixes the bug introduced in #164.

<snark>This wouldn't have happened with TypeScript. ;)</snark>

The module exports a function, not a boolean, so the check for its value would always pass. This breaks WSL (again). We don't need to call the function more than once to find out if we're in docker, so this just calls it right on require.
@pluma pluma requested a review from sindresorhus Jan 30, 2020
@pluma
Copy link
Contributor Author

@pluma pluma commented Jan 30, 2020

/cc @mrbrownt who created the original PR

index.js Outdated Show resolved Hide resolved
@pluma
Copy link
Contributor Author

@pluma pluma commented Jan 30, 2020

I've changed the PR so it's invoking on use rather than on import. I've tested the changes locally and WSL now works again.

@sindresorhus sindresorhus changed the title Call isDocker as a function Fix Docker in WSL2 for real Feb 1, 2020
@sindresorhus sindresorhus merged commit 2c1647d into sindresorhus:master Feb 1, 2020
1 check passed
1 check passed
@travis-ci
Travis CI - Pull Request Build Passed
Details
@pluma pluma deleted the pluma:patch-1 branch Feb 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants