-
+
@@ -9,23 +9,9 @@
diff --git a/client/scripts/generate-content-metadata.ts b/client/scripts/generate-content-metadata.ts
index f2f9f5e..2a2a321 100644
--- a/client/scripts/generate-content-metadata.ts
+++ b/client/scripts/generate-content-metadata.ts
@@ -16,13 +16,13 @@ export type ContentMetadata = Record<
string, // path within content directory
{
mtime: string // timestamp ISO 8601
- }
+ } | undefined
>
const markdownMetadataArray = await Promise.all(
contentMarkdownPaths.map(
(contentMarkdownPath) =>
- new Promise
((resolve, reject) => {
+ new Promise((resolve) => {
git
.log({
file: contentMarkdownPath,
@@ -30,17 +30,18 @@ const markdownMetadataArray = await Promise.all(
strictDate: true
})
.then((gitLog) => {
- if (gitLog.latest?.date) {
- const relativePath = contentMarkdownPath
+ const relativePath = contentMarkdownPath
.substring(contentPath.length)
.replace(/\.md$/, '')
+ if (gitLog.latest?.date) {
resolve({
[relativePath]: { mtime: gitLog.latest?.date }
})
} else {
- reject(
+ console.warn(
`Unable to extract latest Git log time from path ${contentMarkdownPath}`
)
+ resolve({ [relativePath]: undefined })
}
})
})