throw error if notes dir has not been created yet

This commit is contained in:
Triston Armstrong 2023-12-23 21:33:28 -06:00
parent 324f120312
commit 3e692b65fe

View File

@ -36,6 +36,8 @@ export const Node = {
},
getMarkdownFolder: function() {
return path.join(process.cwd(), 'posts')
const notesDir = path.join(process.cwd(), 'notes')
if (!Node.isFile(notesDir)) throw new Error("The notes directory has not been created yet")
return notesDir
}
}