|
@@ -8,16 +8,6 @@ const readline = require('readline').createInterface({
|
|
|
* 上传git
|
|
|
*/
|
|
|
function execFun() {
|
|
|
- // try {
|
|
|
- // execSync('git pull');
|
|
|
- // execSync('git add .');
|
|
|
- // execSync('git commit -m "提交"');
|
|
|
- // execSync('git push');
|
|
|
- // console.log('上传git---完成');
|
|
|
- // } catch (e) {
|
|
|
- // console.log('上传git---失败');
|
|
|
- // console.error(e);
|
|
|
- // }
|
|
|
execSync('git pull');
|
|
|
exec('git status', (err, stream) => {
|
|
|
if (err) return console.err(err);
|
|
@@ -30,7 +20,7 @@ function execFun() {
|
|
|
if (haveAdd) break;
|
|
|
}
|
|
|
readline.question('请输入提交内容:', Input => {
|
|
|
- execSync('git add .');
|
|
|
+ haveAdd && execSync('git add .');
|
|
|
exec(`git commit -m ${Input || '提交'}`, err => {
|
|
|
if (err)
|
|
|
return console.log(`git commit -m ${Input || '提交'} 报错:`, err);
|