mirror of
https://github.com/danbulant/docker-compose
synced 2026-06-24 17:31:53 +00:00
Expose docker-compose exit code in results
This commit is contained in:
parent
0fc9396af9
commit
3467e79244
2 changed files with 4 additions and 1 deletions
1
index.d.ts
vendored
1
index.d.ts
vendored
|
|
@ -63,6 +63,7 @@ interface IDockerComposePushOptions extends IDockerComposeOptions {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IDockerComposeResult {
|
interface IDockerComposeResult {
|
||||||
|
exitCode: number;
|
||||||
out: string;
|
out: string;
|
||||||
err: string;
|
err: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
4
index.js
4
index.js
|
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue