server-esm: Make crash async

This commit is contained in:
Elian Doran
2024-07-18 23:26:21 +03:00
parent 8a30663d1e
commit 013f25a49b
2 changed files with 6 additions and 7 deletions

View File

@@ -125,11 +125,10 @@ function escapeRegExp(str: string) {
return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
}
function crash() {
async function crash() {
if (isElectron()) {
require('electron').app.exit(1);
}
else {
(await import("electron")).app.exit(1);
} else {
process.exit(1);
}
}