Skip to content

Commit 93b4fcb

Browse files
committed
Add shortcut for when it can be detected with os.release()
Only when you manually update Ubuntu it seems. See: sindresorhus/open#50 (comment)
1 parent e342181 commit 93b4fcb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
'use strict';
2+
const os = require('os');
23
const fs = require('fs');
34

45
const isWsl = () => {
56
if (process.platform !== 'linux') {
67
return false;
78
}
89

10+
if (os.release().includes('Microsoft')) {
11+
return true;
12+
}
13+
914
try {
1015
return fs.readFileSync('/proc/version', 'utf8').includes('Microsoft');
1116
} catch (err) {

0 commit comments

Comments
 (0)