mirror of
https://github.com/OBKoro1/autoCommit.git
synced 2024-12-23 01:29:20 +08:00
autoCommit
This commit is contained in:
parent
ae794e1430
commit
26b9b49cb3
15
src/index.js
15
src/index.js
@ -2,7 +2,7 @@
|
|||||||
* Author : OBKoro1
|
* Author : OBKoro1
|
||||||
* Date : 2019-12-19 20:23:57
|
* Date : 2019-12-19 20:23:57
|
||||||
* LastEditors : OBKoro1
|
* LastEditors : OBKoro1
|
||||||
* LastEditTime : 2019-12-20 11:38:26
|
* LastEditTime : 2019-12-20 15:36:23
|
||||||
* FilePath : /autoCommit/index.js
|
* FilePath : /autoCommit/index.js
|
||||||
* Description : 自动commit
|
* Description : 自动commit
|
||||||
* https://github.com/OBKoro1
|
* https://github.com/OBKoro1
|
||||||
@ -23,18 +23,8 @@ class autoCommit {
|
|||||||
this.commit();
|
this.commit();
|
||||||
}
|
}
|
||||||
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(
|
this.myExecSync(
|
||||||
`git add . && git commit -m 'autoCommit' && git pull && git push`
|
`git add . && git commit --amend --date="2019-01-01T00:00:00+0800" -am 'autoCommit' && git pull && git push`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +41,6 @@ class autoCommit {
|
|||||||
});
|
});
|
||||||
return res;
|
return res;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err, err.message, err.stack);
|
|
||||||
console.log(`执行命令出错:${cmd}`);
|
console.log(`执行命令出错:${cmd}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user