fix: stabilize launchd paths and appcast secret scan

This commit is contained in:
Peter Steinberger
2026-03-09 08:37:37 +00:00
parent f9706fde6a
commit 6c579d7842
4 changed files with 14 additions and 31 deletions

View File

@@ -276,8 +276,8 @@ export async function uninstallLegacyLaunchAgents({
return agents;
}
const home = resolveHomeDir(env);
const trashDir = path.join(home, ".Trash");
const home = toPosixPath(resolveHomeDir(env));
const trashDir = path.posix.join(home, ".Trash");
try {
await fs.mkdir(trashDir, { recursive: true });
} catch {
@@ -323,8 +323,8 @@ export async function uninstallLaunchAgent({
return;
}
const home = resolveHomeDir(env);
const trashDir = path.join(home, ".Trash");
const home = toPosixPath(resolveHomeDir(env));
const trashDir = path.posix.join(home, ".Trash");
const dest = path.join(trashDir, `${label}.plist`);
try {
await fs.mkdir(trashDir, { recursive: true });
@@ -415,9 +415,10 @@ export async function installLaunchAgent({
}
const plistPath = resolveLaunchAgentPlistPathForLabel(env, label);
const home = resolveHomeDir(env);
const home = toPosixPath(resolveHomeDir(env));
const libraryDir = path.posix.join(home, "Library");
await ensureSecureDirectory(home);
await ensureSecureDirectory(path.join(home, "Library"));
await ensureSecureDirectory(libraryDir);
await ensureSecureDirectory(path.dirname(plistPath));
const serviceDescription = resolveGatewayServiceDescription({ env, environment, description });