Skip to content

Instantly share code, notes, and snippets.

@Fliktrax
Last active August 26, 2018 00:04
Show Gist options
  • Save Fliktrax/8e1aed6719dd66749c37290bd01cd662 to your computer and use it in GitHub Desktop.
Save Fliktrax/8e1aed6719dd66749c37290bd01cd662 to your computer and use it in GitHub Desktop.
var sys = require('util')
var exec = require('child_process').exec;
var child;
var bashos = 'unix';
child = exec("echo $PATH", function (error, stdout, stderr) {
if( (stdout.indexOf('Windows') > -1) || (stdout.indexOf('System32') > -1) ) {
bashos = 'windows';
}
console.log(bashos);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment