mirror of https://github.com/actions/toolkit
Fix tool output mangled with spawned cmd string
Presently if the exec'd tool is expected to produce an output (i.e. to write to stdout) that can be consumed in a Unix pipeline, assigned to a variable, or similar; the `silent` option must be set in order to avoid the output being mangled by `@actions/exec` to include the full command string that it spawns (and then re-writing out from the provided stdout listener). This commit writes the spawned command string to stderr instead of stdout, as would be expected for logging/debug information as opposed to consumable output data. Closes #649.pull/1573/head
parent
fe3e7ce9a7
commit
7c60c0037a
|
@ -418,8 +418,8 @@ export class ToolRunner extends events.EventEmitter {
|
|||
}
|
||||
|
||||
const optionsNonNull = this._cloneExecOptions(this.options)
|
||||
if (!optionsNonNull.silent && optionsNonNull.outStream) {
|
||||
optionsNonNull.outStream.write(
|
||||
if (!optionsNonNull.silent && optionsNonNull.errStream) {
|
||||
optionsNonNull.errStream.write(
|
||||
this._getCommandString(optionsNonNull) + os.EOL
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue