fixed app termination after unsuccessful migration for electron

This commit is contained in:
azivner
2018-11-18 09:05:50 +01:00
parent 1ee8d9fd93
commit 48684d0509
2 changed files with 13 additions and 2 deletions

View File

@@ -118,6 +118,15 @@ function escapeRegExp(str) {
return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
}
function crash() {
if (isElectron()) {
require('electron').app.exit(1);
}
else {
process.exit(1);
}
}
module.exports = {
randomSecureToken,
randomString,
@@ -137,5 +146,6 @@ module.exports = {
stripTags,
intersection,
union,
escapeRegExp
escapeRegExp,
crash
};