Merge pull request #89 from TriPSs/feature/pre-changelog-generation

fix: Fixed command output empty
releases/v3
Tycho Bokdam 2020-12-15 18:24:30 +01:00 committed by GitHub
commit 7d8e71b99d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 2 deletions

View File

@ -47,10 +47,20 @@ module.exports = new (class Git {
* @return {Promise<>}
*/
exec = (command) => new Promise(async(resolve, reject) => {
const exitCode = await exec.exec(`git ${command}`)
let execOutput = ''
const options = {
listeners: {
stdout: (data) => {
execOutput += data.toString()
},
},
}
const exitCode = await exec.exec(`git ${command}`, null, options)
if (exitCode === 0) {
resolve()
resolve(execOutput)
} else {
reject(`Command "git ${command}" exited with code ${exitCode}.`)