попытка настроить время материала
This commit is contained in:
parent
a7fc2b4ab2
commit
038aad9015
@ -58,16 +58,18 @@ export const CreatedModifiedDate: QuartzTransformerPlugin<Partial<Options>> = (u
|
|||||||
// Get a reference to the main git repo.
|
// Get a reference to the main git repo.
|
||||||
// It's either the same as the workdir,
|
// It's either the same as the workdir,
|
||||||
// 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(file.cwd)
|
repo = Repository.discover("/usr/src/app/content")
|
||||||
|
console.log(chalk.green(`Git repository found at: ${repo.path()}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
modified ||= await repo.getFileLatestModifiedDateAsync(file.data.filePath!)
|
const status = await repo.getStatusAsync();
|
||||||
|
modified ||= await repo.getFileLatestModifiedDateAsync(fullFp!);
|
||||||
|
console.log(chalk.green(`Git repository found at: ${status.tracked.includes(fullFp)}`));
|
||||||
} catch {
|
} catch {
|
||||||
console.log(
|
console.log(
|
||||||
chalk.yellow(
|
chalk.yellow(
|
||||||
`\nWarning: ${file.data
|
`\nWarning: ${fullFp!} isn't yet tracked by git, last modification date is not available for this file`,
|
||||||
.filePath!} isn't yet tracked by git, last modification date is not available for this file`,
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user