Skip to content

Commit

Permalink
Fix check for public vs private
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-linaro committed Sep 18, 2024
1 parent 3a12d1a commit 94945ec
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/applications/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ const reports = await getCollection(
let date: Date | null = null;
type Props = CollectionEntry<"applications">;
let project;
if (import.meta.env.SSR) {
if (!import.meta.env.IS_PUBLIC) {
project = await getEntry("applications", slug);
} else {
project = Astro.props;
try {
const { stdout } = await execAsync(
`git log -1 --pretty="format:%ci" ${process.cwd()}/src/content/applications/${slug}.md`
);
console.log("Output from git log:", stdout);
date = new Date(stdout);
} catch (e) {
throw new Error(`Failed to parse date for ${slug}.md.\n${e}`);
Expand Down

0 comments on commit 94945ec

Please sign in to comment.