From 5e0151634f15fe75357ca927f92d0a43df184653 Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Fri, 8 Jun 2018 16:51:13 +0800 Subject: [PATCH] Update command. --- build/compile.js | 6 +++--- build/deploy.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/compile.js b/build/compile.js index dc5a6eae03..594a6866c9 100644 --- a/build/compile.js +++ b/build/compile.js @@ -276,6 +276,9 @@ function CreateDatajs(dt_path,callback){ json["p"] = md_path.replace(/\.md$/,'').replace(path_md,''); // 命令描述 var des = str.match(/\n==={1,}([\s\S]*?)##/i); + if (!des) { + console.log('格式错误:', error(md_path)); + } des = des[1]?des[1].replace(/\n/g,''):des[1]; des = des.replace(/\r/g,'') json["d"] = des; @@ -289,10 +292,7 @@ function CreateDatajs(dt_path,callback){ //生成数据文件 fs.writeFile(dt_path, 'var linux_commands='+JSON.stringify(indexes) , 'utf8',function(err){ console.log(success("\n → ")+"生成数据成功!"+dt_path+" \n "); - - path_dist = path.join(path_dist,'data.json') - fs.writeFile(path_dist, JSON.stringify(command_data) , 'utf8',function(err){ console.log(success("\n → ")+"生成数据成功!"+path_dist+" \n "); callback&&callback(dt_path,indexes); diff --git a/build/deploy.js b/build/deploy.js index 8b82cf307b..7d00995123 100644 --- a/build/deploy.js +++ b/build/deploy.js @@ -15,7 +15,7 @@ if(fs.existsSync(deploy_path)){ var load = loading(' Pushing code!!') load.start(); ghpages.publish(deploy_path,{ - repo: 'https://github.com/jaywcjlove/linux-command.git', + repo: 'git@github.com:jaywcjlove/linux-command.git', branch: 'gh-pages', message: 'Linux command index, Compiler generation page ' + new Date() }, function(err) {