From b985fd640ab6d046da88a5817b9f3437d67696f5 Mon Sep 17 00:00:00 2001 From: Tycho Bokdam Date: Tue, 15 Dec 2020 18:24:08 +0100 Subject: [PATCH] fix: Fixed command output empty --- src/helpers/git.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/helpers/git.js b/src/helpers/git.js index 188d2b4..66fc04f 100644 --- a/src/helpers/git.js +++ b/src/helpers/git.js @@ -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}.`)