diff --git a/app.js b/app.js index c2aa080..021634d 100644 --- a/app.js +++ b/app.js @@ -40,7 +40,9 @@ function getBranch() { exec('git remote', function (error, stdout, stderr) { // 获取命令执行的输出 if (error) { - throw error; + console.log(error); + reject(error); + return; } // 所有的源 let origin = stdout.split('\n').slice(0, stdout.split('\n').length - 1); @@ -75,7 +77,9 @@ function getBranch() { exec('git init', function (error, stdout, stderr) { // 获取命令执行的输出 if (error) { - throw error; + console.log(error); + reject(error); + return; } console.log('git项目初始化成功'); });