update:2024-08-07 13:27:02 -AutoCommit

This commit is contained in:
539943419 committed 2024-07-06 12:26:01 +08:00
1 parent 02052e960d
commit 167e4a12a8
1 file changed
+17 -3
+17 -3
View File
@@ -1,5 +1,19 @@
import shell from "shelljs";
import _readline from "readline";
import { exec } from 'node:child_process';
import { resolve } from "path";
const execSync = (command)=>new Promise((resolve,rejects)=>{
exec(command,(err,stdout,stderr)=>{
if(err){
console.error(stderr)
rejects(stderr)
}else{
console.log(stdout)
resolve(stdout)
}
})
})
const readline = _readline.createInterface({
input: process.stdin,
@@ -37,7 +51,7 @@ const generateDate = function () {
;(async function(){
const remark = await input('remark:')
const message = `update:${generateDate()} ${remark ? '-remark:'+remark : ''} -AutoCommit`
shell.exec(`git add ."`);
shell.exec(`git commit -m "${message}"`);
shell.exec("git push");
await execSync(`git add ."`);
await execSync(`git commit -m "${message}"`);
await execSync("git push");
})()