fix: bundle node runtime for mac app
This commit is contained in:
@@ -57,7 +57,7 @@ function candidateBinDirs(opts: EnsureClawdbotPathOpts): string[] {
|
||||
|
||||
const candidates: string[] = [];
|
||||
|
||||
// Bun bundled (macOS app): `clawdbot` lives in the Relay dir (process.execPath).
|
||||
// Bundled macOS app: `clawdbot` lives in the Relay dir (process.execPath).
|
||||
try {
|
||||
const execDir = path.dirname(execPath);
|
||||
const siblingClawdbot = path.join(execDir, "clawdbot");
|
||||
@@ -95,7 +95,7 @@ function candidateBinDirs(opts: EnsureClawdbotPathOpts): string[] {
|
||||
|
||||
/**
|
||||
* Best-effort PATH bootstrap so skills that require the `clawdbot` CLI can run
|
||||
* under launchd/minimal environments (and inside the macOS bun bundle).
|
||||
* under launchd/minimal environments (and inside the macOS app bundle).
|
||||
*/
|
||||
export function ensureClawdbotCliOnPath(opts: EnsureClawdbotPathOpts = {}) {
|
||||
if (process.env.CLAWDBOT_PATH_BOOTSTRAPPED === "1") return;
|
||||
|
||||
@@ -4,7 +4,9 @@ import process from "node:process";
|
||||
declare const __CLAWDBOT_VERSION__: string;
|
||||
|
||||
const BUNDLED_VERSION =
|
||||
typeof __CLAWDBOT_VERSION__ === "string" ? __CLAWDBOT_VERSION__ : "0.0.0";
|
||||
(typeof __CLAWDBOT_VERSION__ === "string" && __CLAWDBOT_VERSION__) ||
|
||||
process.env.CLAWDBOT_BUNDLED_VERSION ||
|
||||
"0.0.0";
|
||||
|
||||
function argValue(args: string[], flag: string): string | undefined {
|
||||
const idx = args.indexOf(flag);
|
||||
|
||||
@@ -4,7 +4,9 @@ import process from "node:process";
|
||||
declare const __CLAWDBOT_VERSION__: string | undefined;
|
||||
|
||||
const BUNDLED_VERSION =
|
||||
typeof __CLAWDBOT_VERSION__ === "string" ? __CLAWDBOT_VERSION__ : "0.0.0";
|
||||
(typeof __CLAWDBOT_VERSION__ === "string" && __CLAWDBOT_VERSION__) ||
|
||||
process.env.CLAWDBOT_BUNDLED_VERSION ||
|
||||
"0.0.0";
|
||||
|
||||
function hasFlag(args: string[], flag: string): boolean {
|
||||
return args.includes(flag);
|
||||
|
||||
Reference in New Issue
Block a user