import shell from 'shelljs' const generateDate = function(){ const dateNow = new Date() let year = dateNow.getFullYear(); let month = ("0" + (dateNow.getMonth() + 1)).slice(-2); let day = ("0" + dateNow.getDate()).slice(-2); let hour = dateNow.getHours(); let minute = dateNow.getMinutes(); let seconds = dateNow.getSeconds(); return `${year}-${month}-${day} ${hour}:${minute}:${seconds}` } // console.log(generateDate()) shell.exec('git add .') shell.exec(`git commit -m "update:${generateDate()} AutoCommit"`) shell.exec('git push')