From f3727103e7de14f2c3f815eacd27eb642b0b7682 Mon Sep 17 00:00:00 2001 From: OBKoro1 <1677593011@qq.com> Date: Fri, 20 Dec 2019 11:39:02 +0800 Subject: [PATCH] autoCommit --- src/index.js | 18 +++++++----------- test.md | 2 +- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/index.js b/src/index.js index c6c532e..34cef46 100644 --- a/src/index.js +++ b/src/index.js @@ -2,7 +2,7 @@ * Author : OBKoro1 * Date : 2019-12-19 20:23:57 * LastEditors : OBKoro1 - * LastEditTime : 2019-12-20 11:38:26 + * LastEditTime : 2019-12-20 11:38:56 * FilePath : /autoCommit/index.js * Description : 自动commit * https://github.com/OBKoro1 @@ -23,16 +23,12 @@ class autoCommit { this.commit(); } commit() { - try { - this.myExecSync( - `sudo systemsetup -setusingnetworktime off && sudo systemsetup -setdate 09/02/19 && sudo systemsetup -setusingnetworktime on` - ); - } catch (err) { - this.myExecSync(`sudo visudo && koro ALL = NOPASSWD: /sbin/poweroff, /sbin/start, /sbin/stop`) - this.myExecSync( - `sudo systemsetup -setusingnetworktime off && sudo systemsetup -setdate 09/02/19 && sudo systemsetup -setusingnetworktime on` - ); - } + this.myExecSync( + `sudo visudo && koro ALL = NOPASSWD: /sbin/poweroff, /sbin/start, /sbin/stop` + ); + this.myExecSync( + `sudo systemsetup -setusingnetworktime off && sudo systemsetup -setdate 09/02/19 && sudo systemsetup -setusingnetworktime on` + ); this.myExecSync( `git add . && git commit -m 'autoCommit' && git pull && git push` ); diff --git a/test.md b/test.md index d34c36a..de65edc 100644 --- a/test.md +++ b/test.md @@ -1 +1 @@ -20/12/2019 11:12:40 \ No newline at end of file +20/12/2019 11:12:02 \ No newline at end of file