Skip to content

Commit

Permalink
Add support for WSL (#59)
Browse files Browse the repository at this point in the history
Co-authored-by: Sindre Sorhus <[email protected]>
  • Loading branch information
G-Rath and sindresorhus authored Feb 12, 2020
1 parent 4aefd13 commit 025b705
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict';
const isWSL = require('is-wsl');
const termux = require('./lib/termux.js');
const linux = require('./lib/linux.js');
const macos = require('./lib/macos.js');
Expand All @@ -17,6 +18,11 @@ const platformLib = (() => {

return termux;
default:
// `process.platform === 'linux'` for WSL.
if (isWSL) {
return windows;
}

return linux;
}
})();
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
],
"dependencies": {
"arch": "^2.1.1",
"execa": "^1.0.0"
"execa": "^1.0.0",
"is-wsl": "^2.1.1"
},
"devDependencies": {
"ava": "^2.1.0",
Expand Down

0 comments on commit 025b705

Please sign in to comment.