2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-06-17 03:12:20 +00:00
nativefier/src/infer/inferOs.js

24 lines
514 B
JavaScript
Raw Normal View History

import os from 'os';
function inferPlatform() {
const platform = os.platform();
if (platform === 'darwin' || platform === 'win32' || platform === 'linux') {
return platform;
}
2016-03-25 12:50:52 +00:00
throw `Untested platform ${platform} detected`;
}
function inferArch() {
const arch = os.arch();
if (arch !== 'ia32' && arch !== 'x64') {
throw `Incompatible architecture ${arch} detected`;
}
return arch;
}
export default {
inferPlatform: inferPlatform,
inferArch: inferArch
};