From c2b3b77dccff9c82fb01ab495cf62c97e4058c95 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Sat, 7 Sep 2024 11:06:21 +0300 Subject: [PATCH] =?UTF-8?q?Revert=20"=D0=BF=D0=BE=D0=BF=D1=8B=D1=82=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B8=D1=82=D1=8C?= =?UTF-8?q?=20=D0=B2=D1=80=D0=B5=D0=BC=D1=8F=20=D0=BC=D0=B0=D1=82=D0=B5?= =?UTF-8?q?=D1=80=D0=B8=D0=B0=D0=BB=D0=B0"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 038aad9015a8f2b232738c78d6e6dd396b0ce42a. --- quartz/plugins/transformers/lastmod.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/quartz/plugins/transformers/lastmod.ts b/quartz/plugins/transformers/lastmod.ts index e8f53f644..fe8c01bcf 100644 --- a/quartz/plugins/transformers/lastmod.ts +++ b/quartz/plugins/transformers/lastmod.ts @@ -58,18 +58,16 @@ export const CreatedModifiedDate: QuartzTransformerPlugin> = (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") - console.log(chalk.green(`Git repository found at: ${repo.path()}`)); + repo = Repository.discover(file.cwd) } 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`, ), ) }