refactor: rename bundle identifiers to com.clawdis

This commit is contained in:
Peter Steinberger
2026-01-03 12:26:22 +01:00
parent daa1460502
commit 7165c8a7e5
153 changed files with 282 additions and 242 deletions

View File

@@ -1,3 +1,3 @@
export const GATEWAY_LAUNCH_AGENT_LABEL = "com.steipete.clawdis.gateway";
export const GATEWAY_LAUNCH_AGENT_LABEL = "com.clawdis.gateway";
export const GATEWAY_SYSTEMD_SERVICE_NAME = "clawdis-gateway";
export const GATEWAY_WINDOWS_TASK_NAME = "Clawdis Gateway";

View File

@@ -6,6 +6,7 @@ import { promisify } from "node:util";
import { GATEWAY_LAUNCH_AGENT_LABEL } from "./constants.js";
const execFileAsync = promisify(execFile);
const LEGACY_GATEWAY_LAUNCH_AGENT_LABEL = "com.steipete.clawdis.gateway";
function resolveHomeDir(env: Record<string, string | undefined>): string {
const home = env.HOME?.trim() || env.USERPROFILE?.trim();
@@ -25,6 +26,18 @@ export function resolveLaunchAgentPlistPath(
);
}
function resolveLegacyLaunchAgentPlistPath(
env: Record<string, string | undefined>,
): string {
const home = resolveHomeDir(env);
return path.join(
home,
"Library",
"LaunchAgents",
`${LEGACY_GATEWAY_LAUNCH_AGENT_LABEL}.plist`,
);
}
export function resolveGatewayLogPaths(
env: Record<string, string | undefined>,
): {
@@ -246,6 +259,16 @@ export async function installLaunchAgent({
const { logDir, stdoutPath, stderrPath } = resolveGatewayLogPaths(env);
await fs.mkdir(logDir, { recursive: true });
const legacyPlistPath = resolveLegacyLaunchAgentPlistPath(env);
const domain = resolveGuiDomain();
await execLaunchctl(["bootout", domain, legacyPlistPath]);
await execLaunchctl(["unload", legacyPlistPath]);
try {
await fs.unlink(legacyPlistPath);
} catch {
// ignore
}
const plistPath = resolveLaunchAgentPlistPath(env);
await fs.mkdir(path.dirname(plistPath), { recursive: true });
@@ -258,7 +281,6 @@ export async function installLaunchAgent({
});
await fs.writeFile(plistPath, plist, "utf8");
const domain = resolveGuiDomain();
await execLaunchctl(["bootout", domain, plistPath]);
await execLaunchctl(["unload", plistPath]);
const boot = await execLaunchctl(["bootstrap", domain, plistPath]);