Compare commits
4 Commits
5734699b87
...
145acf4128
Author | SHA1 | Date | |
---|---|---|---|
145acf4128 | |||
c2b3b77dcc | |||
6f04db5d09 | |||
038aad9015 |
@ -58,18 +58,17 @@ export const CreatedModifiedDate: QuartzTransformerPlugin<Partial<Options>> = (u
|
||||
// Get a reference to the main git repo.
|
||||
// It's either the same as the workdir,
|
||||
// or 1+ level higher in case of a submodule/subtree setup
|
||||
repo = Repository.discover("/usr/src/app/content")
|
||||
repo = Repository.discover(file.cwd)
|
||||
console.log(chalk.green(`Git repository found at: ${repo.path()}`));
|
||||
}
|
||||
|
||||
try {
|
||||
const status = await repo.getStatusAsync();
|
||||
modified ||= await repo.getFileLatestModifiedDateAsync(fullFp!);
|
||||
console.log(chalk.green(`Git repository found at: ${status.tracked.includes(fullFp)}`));
|
||||
modified ||= await repo.getFileLatestModifiedDateAsync(file.data.filePath!)
|
||||
} catch {
|
||||
console.log(
|
||||
chalk.yellow(
|
||||
`\nWarning: ${fullFp!} isn't yet tracked by git, last modification date is not available for this file`,
|
||||
`\nWarning: ${file.data
|
||||
.filePath!} isn't yet tracked by git, last modification date is not available for this file`,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user