OpenAsar/src/index.js

20 lines
826 B
JavaScript
Raw Normal View History

2021-12-09 16:25:14 +00:00
const log = require('./utils/log');
global.log = log; // Make log global for easy usage everywhere
global.oaVersion = 'nightly';
2021-12-09 16:25:14 +00:00
2022-02-13 20:52:19 +00:00
log('Init', 'OpenAsar', oaVersion);
if (process.resourcesPath.startsWith('/usr/lib/electron')) global.systemElectron = true; // Using system electron, flag for other places
process.resourcesPath = require('path').join(__dirname, '..'); // Force resourcesPath for system electron
require('./paths').init();
2021-12-09 16:25:14 +00:00
global.oaConfig = require('./appSettings').getSettings().get('openasar', {});
2021-12-21 10:38:18 +00:00
require('./cmdSwitches')();
if (process.argv.includes('--overlay-host')) { // If overlay
require('./utils/u2LoadModulePath')(); // Manually load updater 2 module paths (all modules)
require('discord_overlay2/standalone_host.js'); // Start overlay
} else {
2022-02-13 20:52:19 +00:00
require('./bootstrap')(); // Start bootstrap
}