Skip to content

Commit ac26ea4

Browse files
authored
fix bug with wrapper and stdout (#27)
* fix bug with wrapper and stdout --------- Co-authored-by: mcalhoun <[email protected]>
1 parent d2ed397 commit ac26ea4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

dist/wrapper/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/wrapper.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ const guardAtmosInstalled = async () => {
3030
const args = process.argv.slice(2);
3131
const options = {
3232
listeners,
33-
ignoreReturnCode: true
33+
ignoreReturnCode: true,
34+
silent: true // avoid printing command in stdout: https://github.com/actions/toolkit/issues/649
3435
};
3536

3637
const exitCode = await exec(pathToCLI, args, options);
@@ -39,14 +40,18 @@ const guardAtmosInstalled = async () => {
3940
core.debug(`stderr: ${stderr.contents}`);
4041
core.debug(`exitcode: ${exitCode}`);
4142

43+
// Pass-through stdout/err as `exec` won't anymore because we are passing `silent: true` option
44+
process.stdout.write(stdout.contents);
45+
process.stderr.write(stderr.contents);
46+
4247
// Set outputs, result, exitcode, and stderr
4348
core.setOutput("stdout", stdout.contents);
4449
core.setOutput("stderr", stderr.contents);
4550
core.setOutput("exitcode", exitCode.toString(10));
4651

4752
if (exitCode === 0 || exitCode === 2) {
4853
// A exitCode of 0 is considered a success
49-
// An exitCode of 2 may be returned when the '-detailed-exitcode' option is passed to terraform plan. This denotes
54+
// An exitCode of 2 may be returned when the '-detailed-exitcode' option is passed to atmos terraform plan. This denotes
5055
// Success with non-empty diff (changes present).
5156
return;
5257
}

0 commit comments

Comments
 (0)