1
0
mirror of synced 2025-12-22 11:26:57 -05:00

only require fs.promises

This commit is contained in:
Sarah Schneider
2021-04-09 09:11:01 -04:00
parent 307d1deb59
commit a2e2017e57

View File

@@ -1,4 +1,4 @@
const fs = require('fs')
const fs = require('fs').promises
const path = require('path')
const Page = require('./page')
const { sortBy } = require('lodash')
@@ -14,7 +14,7 @@ module.exports = async function createTree (originalPath, langObj) {
// Otherwise, assume it's a child .md file and add `.md` to the path.
let filepath
try {
await fs.promises.access(originalPath)
await fs.access(originalPath)
filepath = `${originalPath}/index.md`
} catch {
filepath = `${originalPath}.md`