fix(transformer): use path.relative for improved path handling in last modified date calculation

This commit is contained in:
Dralagen 2025-03-13 23:03:46 +01:00
parent 88d8d89171
commit c5cc071590

View File

@ -58,8 +58,7 @@ export const CreatedModifiedDate: QuartzTransformerPlugin<Partial<Options>> = (u
// or 1+ level higher in case of a submodule/subtree setup // or 1+ level higher in case of a submodule/subtree setup
repo = Repository.discover(fullFp) repo = Repository.discover(fullFp)
} }
const relativePath = path.relative(repo.workdir()!, fullFp)
var relativePath = fullFp.replace(repo.workdir()!, "")
try { try {
modified ||= await repo.getFileLatestModifiedDateAsync(relativePath) modified ||= await repo.getFileLatestModifiedDateAsync(relativePath)