feat: add components
This commit is contained in:
16
components/component-os.js
Normal file
16
components/component-os.js
Normal file
@@ -0,0 +1,16 @@
|
||||
|
||||
// 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;
|
||||
}
|
||||
Reference in New Issue
Block a user