fix: Fixed command output empty
parent
d68d2f2010
commit
b985fd640a
|
@ -47,10 +47,20 @@ module.exports = new (class Git {
|
||||||
* @return {Promise<>}
|
* @return {Promise<>}
|
||||||
*/
|
*/
|
||||||
exec = (command) => new Promise(async(resolve, reject) => {
|
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) {
|
if (exitCode === 0) {
|
||||||
resolve()
|
resolve(execOutput)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
reject(`Command "git ${command}" exited with code ${exitCode}.`)
|
reject(`Command "git ${command}" exited with code ${exitCode}.`)
|
||||||
|
|
Loading…
Reference in New Issue