electrobun 0.0.19-beta.83 → 0.0.19-beta.84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/bun/core/Updater.ts +23 -3
- package/package.json +1 -1
|
@@ -4,6 +4,13 @@ import { renameSync, unlinkSync, mkdirSync, rmdirSync, statSync, readdirSync } f
|
|
|
4
4
|
import tar from "tar";
|
|
5
5
|
import { ZstdInit } from "@oneidentity/zstd-js/wasm";
|
|
6
6
|
import { OS as currentOS, ARCH as currentArch } from '../../shared/platform';
|
|
7
|
+
import { native } from '../proc/native';
|
|
8
|
+
|
|
9
|
+
// setTimeout(async () => {
|
|
10
|
+
// console.log('killing')
|
|
11
|
+
// const { native } = await import('../proc/native');
|
|
12
|
+
// native.symbols.killApp();
|
|
13
|
+
// }, 1000)
|
|
7
14
|
|
|
8
15
|
// Cross-platform app data directory
|
|
9
16
|
function getAppDataDir(): string {
|
|
@@ -482,12 +489,25 @@ start "" launcher.exe
|
|
|
482
489
|
await Bun.spawn(["cmd", "/c", runBatPath], { detached: true });
|
|
483
490
|
break;
|
|
484
491
|
case 'linux':
|
|
485
|
-
// On Linux, use
|
|
492
|
+
// On Linux, use shell backgrounding to detach the process
|
|
486
493
|
const linuxLauncher = join(runningAppBundlePath, "bin", "launcher");
|
|
487
|
-
Bun.spawn(["sh", "-c",
|
|
494
|
+
Bun.spawn(["sh", "-c", `${linuxLauncher} &`], { detached: true});
|
|
488
495
|
break;
|
|
489
496
|
}
|
|
490
|
-
|
|
497
|
+
// Use native killApp to properly clean up all resources on Linux
|
|
498
|
+
// On other platforms, process.exit works fine
|
|
499
|
+
if (currentOS === 'linux') {
|
|
500
|
+
try {
|
|
501
|
+
|
|
502
|
+
native.symbols.killApp();
|
|
503
|
+
process.exit(0);
|
|
504
|
+
} catch (e) {
|
|
505
|
+
// Fallback if native binding fails
|
|
506
|
+
process.exit(0);
|
|
507
|
+
}
|
|
508
|
+
} else {
|
|
509
|
+
process.exit(0);
|
|
510
|
+
}
|
|
491
511
|
}
|
|
492
512
|
}
|
|
493
513
|
},
|
package/package.json
CHANGED