add debug logs

Signed-off-by: Luca Stocchi <lstocchi@redhat.com>
This commit is contained in:
Luca Stocchi 2020-11-06 23:57:01 +01:00
parent 3c136d27ac
commit 20c4f351ec
No known key found for this signature in database
GPG key ID: 930BB00F3FCF30A4
4 changed files with 29 additions and 22 deletions

View file

@ -60,18 +60,17 @@ class BuildahCli {
}
let output = '';
let error = '';
const options = {
listeners: {
stdout: (data) => {
output += data.toString();
},
stderr: (data) => {
error += data.toString();
}
const options = {};
options.listeners = {
stdout: (data) => {
output += data.toString();
},
stderr: (data) => {
error += data.toString();
}
};
yield exec.exec(`${this.executable}`, args, options);
if (error) {
const exitCode = yield exec.exec(this.executable, args, options);
if (exitCode === 1) {
return Promise.resolve({ succeeded: false, error: error });
}
return Promise.resolve({ succeeded: true, output: output });