Skip to content

Commit

Permalink
fix(imports): fix checking submodules to prevent error on start
Browse files Browse the repository at this point in the history
  • Loading branch information
DEgITx committed Jun 6, 2023
1 parent f9ec0c2 commit 03f0ab7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ if(portative)
process.on('unhandledRejection', r => logTE('system', 'Rejection:', r));
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()
if (!gotTheLock) {
logT('app', 'closed because of second application')
Expand Down
5 changes: 5 additions & 0 deletions src/background/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ if(majorVersion < 8)
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'));

appConfig.restApi = true;
Expand Down

0 comments on commit 03f0ab7

Please sign in to comment.