Open cwrau opened 3 years ago
There's a getArgs()
you can use instead
As I understand, that method only sets args for the command, not npx
itself
hmm, I'll have to think a little bit about that, but in the meantime a not-so-pretty-workaround is to set --package
as command and args.addAll(npxPackage)
the way that it's done is that the full command is added by taking command and then adding args: https://github.com/node-gradle/gradle-node-plugin/blob/1d9259d/src/main/kotlin/com/github/gradle/node/npm/task/NpxTask.kt#L67-L68
Nice, that workaround works!
The workaround suggested by deepy works but it would be nice if we could add support of this correctly by adding a packageName
optional property for instance. I did not know about this option when I started working on this NpxTask
.
Npx has the feature to call a command from a package whose name differs from the command.
This can be achieved with the
npx
flag--package
as seen on https://www.npmjs.com/package/npxBefore 3.0.0 I accessed the
runner
property of theNpxTask
to set the argument;Since the 3.0.0 release, the
runner
property of theNpxTask
is not available anymoreCould you implement this feature into the task or show me a way to set this argument again?