node-gradle / gradle-node-plugin

Gradle plugin for integrating NodeJS in your build. :rocket:
Apache License 2.0
616 stars 120 forks source link

[NpxTask] Provide a way to capture System.out/err #316

Closed jschneider closed 4 months ago

jschneider commented 4 months ago

I am running an npx task with "ibm-openapi-validator". I would love to save the result in a reports file. Unfortunately "ibm-openapi-validator" does not provide a way to write a report directly.

I would like to capture the output of the process and save it in a report file. The exec task provides ways to redirect stdout and stderr.

Maybe add a similar feature at least to the npx task?

jschneider commented 4 months ago

When calling projectHelper.exec{} "errorOutput" and "standardOutput" can be configured

jschneider commented 4 months ago

Okay, I realised I can do this:

      execOverrides {
        this.standardOutput = outputStream
      }