diff --git a/README.md b/README.md index ea724db..cd50f86 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ # 用于学习交流 + @@ -9,4 +10,8 @@ - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/images/icon.png b/images/icon.png new file mode 100644 index 0000000..a187e7e Binary files /dev/null and b/images/icon.png differ diff --git a/package.json b/package.json index ef19f10..dc38f8a 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "email": "obkoro1@foxmail.com", "url": "http://obkoro1.com/web_accumulate/" }, + "icon": "images/icon.png", "galleryBanner": { "color": "#3B4859", "theme": "dark" @@ -63,6 +64,9 @@ "github commit", "github autoCommit", "git commit", + "自动提交", + "git 自动提交", + "github 自动提交", "git", "github", "commit", diff --git a/src/models/commitHandle.ts b/src/models/commitHandle.ts index 303f1e8..288eabf 100644 --- a/src/models/commitHandle.ts +++ b/src/models/commitHandle.ts @@ -2,7 +2,7 @@ * Author : OBKoro1 * Date : 2019-12-30 16:59:30 * LastEditors : OBKoro1 - * LastEditTime : 2020-01-02 14:18:36 + * LastEditTime : 2020-01-02 16:22:22 * FilePath : /autoCommit/src/models/commitHandle.ts * Description : commit 具体操作 * https://github.com/OBKoro1 @@ -49,13 +49,14 @@ class CommitHandle { let index = this.timeArr.findIndex(element => { return element.value === ele; }); - // 添加不存在的日期 - if (index === -1) { - this.timeArr.push({ - value: ele, - commitNumber: item.commitNumber - }); + // 删除重复日期 + if (index !== -1) { + this.timeArr.splice(index, 1); } + this.timeArr.push({ + value: ele, + commitNumber: item.commitNumber + }); }); }); this.sortTime(); @@ -125,7 +126,7 @@ class CommitHandle { }); }); } catch (err) { - continue; // 错误 退出本次循环 + continue; // 错误 退出本次循环 } } else { // 模拟git提交 @@ -196,7 +197,7 @@ class CommitHandle { } return timeArr; } - // 同步执行命令 + // 同步执行命令 myExecSync(cmd: string) { // 除了该方法直到子进程完全关闭后才返回 执行完毕 返回 try {