17 lines
517 B
JavaScript
17 lines
517 B
JavaScript
|
|
// https://stackoverflow.com/questions/246007/how-to-determine-whether-a-given-linux-is-32-bit-or-64-bit
|
|
// https://stackoverflow.com/questions/106387/is-it-possible-to-detect-32-bit-vs-64-bit-in-a-bash-script
|
|
var getOS = () => {
|
|
var osName = $STR($$.shell().commands('uname').start()[0]).trim();
|
|
var arch = $STR($$.shell().commands('uname', '-m').start()[0]).trim(); // OR getconf LONG_BIT
|
|
|
|
return {
|
|
'name': osName,
|
|
'arch': arch
|
|
};
|
|
};
|
|
|
|
if (typeof exports == 'object') {
|
|
exports.getOS = getOS;
|
|
}
|