This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/is-wsl/index.js

26 lines
426 B
JavaScript
Raw Normal View History

2019-08-11 18:48:02 +00:00
'use strict';
const os = require('os');
const fs = require('fs');
const isWsl = () => {
if (process.platform !== 'linux') {
return false;
}
if (os.release().includes('Microsoft')) {
return true;
}
try {
return fs.readFileSync('/proc/version', 'utf8').includes('Microsoft');
} catch (err) {
return false;
}
};
if (process.env.__IS_WSL_TEST__) {
module.exports = isWsl;
} else {
module.exports = isWsl();
}