is-windows-bash
Advanced tools
Comparing version 1.0.0 to 1.0.1
14
index.js
fs = require('fs') | ||
module.exports = () => { | ||
if (process.platform.toLowerCase() === 'linux' && | ||
function isWindowsBash() { | ||
if (process.platform.toLowerCase() === 'linux' && | ||
process.env.SHELL.toLowerCase() === '/bin/bash') { | ||
try { | ||
const data = fs.readFileSync('/proc/version', 'utf-8'); | ||
return data.toLowerCase().includes('microsoft'); | ||
} catch (err) { | ||
var data = fs.readFileSync('/proc/version', 'utf-8'); | ||
return data.toLowerCase().indexOf('microsoft') > -1; | ||
} catch (err) { | ||
return false; | ||
@@ -15,2 +15,4 @@ } | ||
return false; | ||
}; | ||
} | ||
module.exports = isWindowsBash; |
{ | ||
"name": "is-windows-bash", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Determines if Node is running on Windows Bash (WSL)", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2904
51