Skip to content

Commit

Permalink
Tweak date retrieval again
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-linaro committed Sep 18, 2024
1 parent b9068fc commit bdea25d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pages/applications/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ if (!import.meta.env.IS_PUBLIC) {
project = Astro.props;
try {
const { stdout } = await execAsync(
`git log -1 --pretty="format:%ci" -- "${process.cwd()}/src/content/applications/${slug}.md"`
`git log -1 --pretty="format:%ci" src/content/applications/${slug}.md`
);
if (stdout == "") {
throw new Error(`Failed to retrieve date for ${slug}.md`);
}
date = new Date(stdout);
} catch (e) {
throw new Error(`Failed to parse date for ${slug}.md.\n${e}`);
Expand Down

0 comments on commit bdea25d

Please sign in to comment.