Skip to content

Commit

Permalink
feat(version-tip): 返回version信息
Browse files Browse the repository at this point in the history
  • Loading branch information
novlan1 committed Jul 19, 2022
1 parent 1945858 commit cc015d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/version-tip/gen-version.bash
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ function doStandardVerison() {
msg_info "pushing..."
git push --follow-tags origin
fi;

msg_success "GEN VERSION SUCCESS"
}

main $1
Expand Down
15 changes: 9 additions & 6 deletions src/version-tip/gen-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}
})
})
}

0 comments on commit cc015d7

Please sign in to comment.