Canonicalize hook metadata file paths
This commit is contained in:
parent
15fd465a48
commit
9ec1f01b5a
@ -81,11 +81,19 @@ function loadHookFromDir(params: {
|
||||
nameHint?: string;
|
||||
}): Hook | null {
|
||||
const hookMdPath = path.join(params.hookDir, "HOOK.md");
|
||||
const content = readBoundaryFileUtf8({
|
||||
const safeHookMdPath = resolveBoundaryFilePath({
|
||||
absolutePath: hookMdPath,
|
||||
rootPath: params.hookDir,
|
||||
boundaryLabel: "hook directory",
|
||||
});
|
||||
if (!safeHookMdPath) {
|
||||
return null;
|
||||
}
|
||||
const content = readBoundaryFileUtf8({
|
||||
absolutePath: safeHookMdPath,
|
||||
rootPath: params.hookDir,
|
||||
boundaryLabel: "hook directory",
|
||||
});
|
||||
if (content === null) {
|
||||
return null;
|
||||
}
|
||||
@ -127,7 +135,7 @@ function loadHookFromDir(params: {
|
||||
description,
|
||||
source: params.source,
|
||||
pluginId: params.pluginId,
|
||||
filePath: hookMdPath,
|
||||
filePath: safeHookMdPath,
|
||||
baseDir,
|
||||
handlerPath,
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user