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 f80174d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions packages/docker-compose-js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,10 @@ 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) {
resolve(stderr);
}
resolve(stdout);
// sometimes a command is successful (no error), but prints a failure of
// some kind to stderr. If no stdout, return stderr instead.
const msg = stdout !== '' ? stdout : stderr;
resolve(msg);
}
});
}
Expand Down

0 comments on commit f80174d

Please sign in to comment.