Expose docker-compose exit code in results

This commit is contained in:
Jannis Pohlmann 2019-04-29 15:07:33 +02:00
parent 0fc9396af9
commit 3467e79244
2 changed files with 4 additions and 1 deletions

1
index.d.ts vendored
View file

@ -63,6 +63,7 @@ interface IDockerComposePushOptions extends IDockerComposeOptions {
} }
interface IDockerComposeResult { interface IDockerComposeResult {
exitCode: number;
out: string; out: string;
err: string; err: string;
} }

View file

@ -67,6 +67,7 @@ const execCompose = (command, args, options) => new Promise((resolve, reject) =>
}); });
const result = { const result = {
exitCode: 0,
err: '', err: '',
out: '' out: ''
}; };
@ -79,7 +80,8 @@ const execCompose = (command, args, options) => new Promise((resolve, reject) =>
result.err += chunk.toString(); result.err += chunk.toString();
}); });
childProc.on('close', () => { childProc.on('close', (exitCode, _) => {
result.exitCode = exitCode;
resolve(result); resolve(result);
}); });