electrobun 0.0.19-beta.92 → 0.0.19-beta.94
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 +47 -0
- package/package.json +1 -1
|
@@ -13,6 +13,50 @@ import { native } from '../proc/native';
|
|
|
13
13
|
// native.symbols.killApp();
|
|
14
14
|
// }, 1000)
|
|
15
15
|
|
|
16
|
+
// Create or update run.sh launcher script for Linux
|
|
17
|
+
async function createLinuxLauncherScript(appDir: string): Promise<void> {
|
|
18
|
+
const parentDir = dirname(appDir);
|
|
19
|
+
const launcherPath = join(parentDir, "run.sh");
|
|
20
|
+
|
|
21
|
+
const launcherContent = `#!/bin/bash
|
|
22
|
+
# Electrobun App Launcher
|
|
23
|
+
# This script sets up the environment and launches the app
|
|
24
|
+
|
|
25
|
+
# Get the directory where this script is located
|
|
26
|
+
SCRIPT_DIR="$(cd "$(dirname "\${BASH_SOURCE[0]}")" && pwd)"
|
|
27
|
+
APP_DIR="$SCRIPT_DIR/app"
|
|
28
|
+
|
|
29
|
+
cd "$APP_DIR/bin"
|
|
30
|
+
export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"
|
|
31
|
+
|
|
32
|
+
# Force X11 backend for compatibility
|
|
33
|
+
export GDK_BACKEND=x11
|
|
34
|
+
|
|
35
|
+
# Check if CEF libraries exist and set LD_PRELOAD
|
|
36
|
+
if [ -f "./libcef.so" ] || [ -f "./libvk_swiftshader.so" ]; then
|
|
37
|
+
CEF_LIBS=""
|
|
38
|
+
[ -f "./libcef.so" ] && CEF_LIBS="./libcef.so"
|
|
39
|
+
if [ -f "./libvk_swiftshader.so" ]; then
|
|
40
|
+
if [ -n "$CEF_LIBS" ]; then
|
|
41
|
+
CEF_LIBS="$CEF_LIBS:./libvk_swiftshader.so"
|
|
42
|
+
else
|
|
43
|
+
CEF_LIBS="./libvk_swiftshader.so"
|
|
44
|
+
fi
|
|
45
|
+
fi
|
|
46
|
+
export LD_PRELOAD="$CEF_LIBS"
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
exec ./launcher "$@"
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
await Bun.write(launcherPath, launcherContent);
|
|
53
|
+
|
|
54
|
+
// Make it executable
|
|
55
|
+
execSync(`chmod +x "${launcherPath}"`);
|
|
56
|
+
|
|
57
|
+
console.log(`Created/updated Linux launcher script: ${launcherPath}`);
|
|
58
|
+
}
|
|
59
|
+
|
|
16
60
|
// Cross-platform app data directory
|
|
17
61
|
function getAppDataDir(): string {
|
|
18
62
|
switch (currentOS) {
|
|
@@ -473,6 +517,9 @@ const Updater = {
|
|
|
473
517
|
|
|
474
518
|
// Move new app to app location
|
|
475
519
|
renameSync(newAppBundlePath, runningAppBundlePath);
|
|
520
|
+
|
|
521
|
+
// Recreate run.sh launcher script
|
|
522
|
+
await createLinuxLauncherScript(runningAppBundlePath);
|
|
476
523
|
} else {
|
|
477
524
|
// On Windows, use versioned app folders
|
|
478
525
|
const parentDir = dirname(runningAppBundlePath);
|
package/package.json
CHANGED