From cc015d79023fef6c18d7bcad712d658a26759b87 Mon Sep 17 00:00:00 2001 From: novlan1 <1576271227@qq.com> Date: Tue, 19 Jul 2022 20:00:37 +0800 Subject: [PATCH] =?UTF-8?q?feat(version-tip):=20=E8=BF=94=E5=9B=9Eversion?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/version-tip/gen-version.bash | 2 ++ src/version-tip/gen-version.ts | 15 +++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/version-tip/gen-version.bash b/src/version-tip/gen-version.bash index c9dae9a1..9eb873b6 100644 --- a/src/version-tip/gen-version.bash +++ b/src/version-tip/gen-version.bash @@ -158,6 +158,8 @@ function doStandardVerison() { msg_info "pushing..." git push --follow-tags origin fi; + + msg_success "GEN VERSION SUCCESS" } main $1 diff --git a/src/version-tip/gen-version.ts b/src/version-tip/gen-version.ts index ad068521..33ea3a8a 100644 --- a/src/version-tip/gen-version.ts +++ b/src/version-tip/gen-version.ts @@ -14,11 +14,14 @@ */ export function genVersion({ path, execFile, needPush = 0 }) { const bashFile = path.resolve(__dirname, './gen-version.bash') - execFile('bash', [bashFile, needPush], (error, stdout, stderr) => { - if (error) { - throw error - } - console.log(stdout) - console.log('stderr: ', stderr) + + return new Promise((resolve, reject) => { + execFile('bash', [bashFile, needPush], (error, stdout, stderr) => { + if (error) { + reject(error) + } else { + resolve({ stdout, stderr }) + } + }) }) }