Skip to content

Commit 7ddacd1

Browse files
authored
Merge pull request #49 from dzcode-io/bugfix/data-generation-no-content
🐞 fix: data generation breaks when no content
2 parents d185a6f + 9461fab commit 7ddacd1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

data/src/utils/data.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ export const getDataEntry = (path: string, include?: string[]) => {
3434
}
3535

3636
// Read content.md
37-
if (!include || include.includes("content"))
37+
if (
38+
(!include || include.includes("content")) &&
39+
fse.existsSync(`${path}/content.md`)
40+
)
3841
entry = {
3942
...entry,
4043
content: String(fse.readFileSync(`${path}/content.md`)),

0 commit comments

Comments
 (0)