Files
js-scripts/components/component-os.js
2025-04-04 17:19:07 +08:00

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;
}