Skip to content

Commit

Permalink
fix: gitCommitRemarkPlugin use correct variable
Browse files Browse the repository at this point in the history
  • Loading branch information
rayhanadev committed Jan 4, 2025
1 parent d538ce8 commit c7d66be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/blog/gitCommitRemarkPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { execSync } from "node:child_process";
import path from "node:path";

import type { Root } from "mdast";
import type { Plugin } from "unified";
Expand All @@ -21,7 +20,9 @@ export function gitCommitRemarkPlugin(): RemarkPlugin {
return;
}

const commit = execSync(`git log -n 1 --pretty=format:%h -- ${path}`)
const commit = execSync(
`git log -n 1 --pretty=format:%h -- ${filepath}`,
)
.toString()
.trim();

Expand Down

0 comments on commit c7d66be

Please sign in to comment.