diff --git a/lib/crasher.js b/lib/crasher.js index 7367704f6..f0b050fc7 100644 --- a/lib/crasher.js +++ b/lib/crasher.js @@ -3,6 +3,7 @@ const { isBare, platform, arch } = require('which-runtime') const fs = isBare ? require('bare-fs') : require('fs') const path = isBare ? require('bare-path') : require('path') const checkout = require('../checkout') +const os = isBare ? require('bare-os') : require('os') let hasLogged = false const start = Date.now() @@ -25,7 +26,11 @@ function logCrashAndExit (logPath, errorInfo, checkout, stackTrace, err) { console.error(`Error logged at ${logPath}`) - runContext.exit(1) + if (isBare) { + os.kill(pid) + } else { + runContext.exit(1) + } } function setupCrashHandlers (processName, swap) {