mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-06-02 21:00:48 +00:00
8f78dd03af
- Add `npm run lint:fix` command - Cleanup inferIcon.js logic slightly
24 lines
483 B
JavaScript
24 lines
483 B
JavaScript
import os from 'os';
|
|
|
|
function inferPlatform() {
|
|
const platform = os.platform();
|
|
if (platform === 'darwin' || platform === 'win32' || platform === 'linux') {
|
|
return platform;
|
|
}
|
|
|
|
throw new Error(`Untested platform ${platform} detected`);
|
|
}
|
|
|
|
function inferArch() {
|
|
const arch = os.arch();
|
|
if (arch !== 'ia32' && arch !== 'x64') {
|
|
throw new Error(`Incompatible architecture ${arch} detected`);
|
|
}
|
|
return arch;
|
|
}
|
|
|
|
export default {
|
|
inferPlatform,
|
|
inferArch,
|
|
};
|