fix: 添加异常捕获
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "markdown-from-posts",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"description": "从posts文件夹中读取文件,根据时间,category,tags进行排列",
|
||||
"main": "src/index.js",
|
||||
"exports": {
|
||||
|
@@ -4,6 +4,7 @@ const fs = require('fs-extra')
|
||||
const path = require('path')
|
||||
|
||||
module.exports = { getPosts:async()=>{
|
||||
try {
|
||||
let paths = await getPostMDFilePaths()
|
||||
let posts = await Promise.all(
|
||||
paths.map(async (item) => {
|
||||
@@ -21,6 +22,10 @@ module.exports = { getPosts:async()=>{
|
||||
)
|
||||
posts.sort(_compareDate)
|
||||
return posts
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
} }
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user