Update file.js
This commit is contained in:
parent
911fe272d6
commit
e3941ae31c
|
@ -1,5 +1,6 @@
|
||||||
const fs = require('fs')
|
const markdownInclude = require('markdown-include')
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
|
const fs = require('fs')
|
||||||
|
|
||||||
const rootPath = path.resolve(__dirname) + '/../../'
|
const rootPath = path.resolve(__dirname) + '/../../'
|
||||||
const file = {}
|
const file = {}
|
||||||
|
@ -30,8 +31,8 @@ file.create = function (filename, data = '') {
|
||||||
fs.writeFileSync(rootPath + filename, data)
|
fs.writeFileSync(rootPath + filename, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
file.compileMarkdown = function (filepath) {
|
file.compileMarkdown = function (filename) {
|
||||||
return markdownInclude.compileFiles(path.resolve(__dirname, filepath))
|
markdownInclude.compileFiles(rootPath + filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = file
|
module.exports = file
|
||||||
|
|
Loading…
Reference in New Issue