Skip to content

Commit

Permalink
去掉console
Browse files Browse the repository at this point in the history
  • Loading branch information
lilinsen committed Jan 23, 2019
1 parent faa4df0 commit a86d855
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions scripts/mdToVue.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ function readDirRecur(fileSrc, callback) {
* 判断是否位md文件 并进行操作
* @src {string} 打开的文件目录
*/
function ismd(src){
function ismd(src,callback){
//判断文件类型是否是md文件
let filedir = src;
return new Promise((resolve,reject)=>{
//return new Promise((resolve,reject)=>{
if (/.md$/.test(filedir)) {
//文件读取
fs.readFile(filedir, 'utf-8', (err, data) => {
Expand All @@ -149,17 +149,21 @@ function ismd(src){
//如果不是doc命名的文件
mdName = opensName;
}
resolve({
callback({
mdName:mdName,
html:html
})
// resolve({
// mdName:mdName,
// html:html
// })
//创建文件

});
}else{
reject('nomd')
//reject('nomd')
}
})
//})


}
Expand Down Expand Up @@ -191,7 +195,11 @@ function fileDisplay(param) {
//文件列表

fileList.map(item=>{
ismd(item).then(res=>{
// ismd(item).then(res=>{
// //res md文件处理结果
// createdFile(param.output + '/' + res.mdName + '.vue', res.html, param.needCode)
// })
ismd(item,res=>{
//res md文件处理结果
createdFile(param.output + '/' + res.mdName + '.vue', res.html, param.needCode)
})
Expand Down

0 comments on commit a86d855

Please sign in to comment.