mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-19 05:16:27 -07:00
feat(launcher): bundle Bun and use it across all launchers (#243)
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { cleanupOldWindowsManagedRuntimes, stageManagedLauncher } from './managed-launcher';
|
||||
|
||||
// Bundled separately as Node-compatible code so AppImages can prepare their
|
||||
// runtime without starting Electron's GUI, single-instance lock, or settings.
|
||||
export function prepareLauncherRuntime(options: { appPath: string; resourcesPath: string }) {
|
||||
const appVersion = fs
|
||||
.readFileSync(path.join(options.resourcesPath, 'launcher', 'version'), 'utf8')
|
||||
.trim();
|
||||
const payload = stageManagedLauncher({
|
||||
appExePath: options.appPath,
|
||||
appVersion,
|
||||
bundledBunPath: path.join(
|
||||
options.resourcesPath,
|
||||
'bun',
|
||||
process.platform === 'win32' ? 'bun.exe' : 'bun',
|
||||
),
|
||||
launcherResourcePath: path.join(options.resourcesPath, 'launcher', 'subminer.js'),
|
||||
force: process.platform === 'linux',
|
||||
});
|
||||
if (process.platform === 'win32') cleanupOldWindowsManagedRuntimes({ appVersion });
|
||||
return payload;
|
||||
}
|
||||
Reference in New Issue
Block a user