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.
@@ -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 'at now' to detach the new process completely
492
+ // On Linux, use shell backgrounding to detach the process
486
493
  const linuxLauncher = join(runningAppBundlePath, "bin", "launcher");
487
- Bun.spawn(["sh", "-c", `echo '${linuxLauncher}' | at now`], { detached: true });
494
+ Bun.spawn(["sh", "-c", `${linuxLauncher} &`], { detached: true});
488
495
  break;
489
496
  }
490
- process.exit(0);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrobun",
3
- "version": "0.0.19-beta.83",
3
+ "version": "0.0.19-beta.84",
4
4
  "description": "Build ultra fast, tiny, and cross-platform desktop apps with Typescript.",
5
5
  "license": "MIT",
6
6
  "author": "Blackboard Technologies Inc.",