fix(imports): fix checking submodules to prevent error on start

This commit is contained in:
Alexey Kasyanchuk 2023-06-06 04:07:12 +03:00
parent f9ec0c2cbb
commit 03f0ab7a47
2 changed files with 10 additions and 0 deletions

View File

@ -102,6 +102,11 @@ if(portative)
process.on('unhandledRejection', r => logTE('system', 'Rejection:', r)); process.on('unhandledRejection', r => logTE('system', 'Rejection:', r));
process.on('uncaughtException', (err, origin) => logTE('system', 'Exception:', err, 'Origin:', origin)); process.on('uncaughtException', (err, origin) => logTE('system', 'Exception:', err, 'Origin:', origin));
if (env.name !== "production" && (!fs.existsSync(__dirname + '/../imports') || fs.readdirSync(__dirname + '/../imports').length == 0)) {
logTE('system', 'You are not clonned submodules correctly, please use git clone --recurse-submodules https://github.com/DEgITx/rats-search.git');
process.exit(1);
}
const gotTheLock = app.requestSingleInstanceLock() const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) { if (!gotTheLock) {
logT('app', 'closed because of second application') logT('app', 'closed because of second application')

View File

@ -40,6 +40,11 @@ if(majorVersion < 8)
process.exit(1); process.exit(1);
} }
if (!fs.existsSync(__dirname + '/../../imports') || fs.readdirSync(__dirname + '/../../imports').length == 0) {
logTE('system', 'You are not clonned submodules correctly, please use git clone --recurse-submodules https://github.com/DEgITx/rats-search.git');
process.exit(1);
}
app.use(express.static('web')); app.use(express.static('web'));
appConfig.restApi = true; appConfig.restApi = true;