only require fs.promises
This commit is contained in:
@@ -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`
|
||||
|
||||
Reference in New Issue
Block a user