update:2024-08-07 13:27:02 -AutoCommit
This commit is contained in:
1 parent
02052e960d
commit
167e4a12a8
1 file changed
+17
-3
+17
-3
@@ -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");
|
||||
})()
|
||||
Reference in new issue
Block a user