fix: harden plugin and hook install paths

This commit is contained in:
Peter Steinberger
2026-02-02 02:04:50 -08:00
parent be9a2fb134
commit d03eca8450
9 changed files with 307 additions and 14 deletions

View File

@@ -771,7 +771,13 @@ export function registerHooksCli(program: Command): void {
continue;
}
const installPath = record.installPath ?? resolveHookInstallDir(hookId);
let installPath: string;
try {
installPath = record.installPath ?? resolveHookInstallDir(hookId);
} catch (err) {
defaultRuntime.log(theme.error(`Invalid install path for "${hookId}": ${String(err)}`));
continue;
}
const currentVersion = await readInstalledPackageVersion(installPath);
if (opts.dryRun) {