Update command.

This commit is contained in:
jaywcjlove 2018-06-08 16:51:13 +08:00
parent f873307e6e
commit 5e0151634f
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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) {