Skip to content

Commit

Permalink
fix return value for runCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
busma13 committed Jan 8, 2025
1 parent 5011946 commit 1fe9c19
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions packages/docker-compose-js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,13 @@ export class Compose {
error.stdout = stdout;
reject(error);
} else {
// sometimes a command is successful (no error), but prints a failure
// of some kind to stderr. It may also print to stdout, so return both.
if (stderr && stdout) {
resolve(`stdout: ${stdout}, stderr: ${stderr}`);
}
if (stderr) {
// sometimes a command is successful (no error), but prints a failure of
// some kind to stderr. If no stdout, return stderr instead.
if (stdout) {
resolve(stdout);
} else {
resolve(stderr);
}
resolve(stdout);
}
});
}
Expand Down

0 comments on commit 1fe9c19

Please sign in to comment.