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

@@ -189,7 +189,17 @@ export async function updateNpmInstalledPlugins(params: {
continue;
}
const installPath = record.installPath ?? resolvePluginInstallDir(pluginId);
let installPath: string;
try {
installPath = record.installPath ?? resolvePluginInstallDir(pluginId);
} catch (err) {
outcomes.push({
pluginId,
status: "error",
message: `Invalid install path for "${pluginId}": ${String(err)}`,
});
continue;
}
const currentVersion = await readInstalledPackageVersion(installPath);
if (params.dryRun) {