Closed StephenChamberlain closed 2 years ago
I'm not familiar with grunt, but having skimmed the page maybe the args is supposed to be ["--verbose", "mytask", "--version=bla"]
?
I guess the question is, do you want to pass the arg to grunt or do your grunt task? If it's the former then the arg should appear before your task, if it's the latter it should appear after, probably.
Thanks for the reply; I've tried both variants, but these both lead to the same error:
grunt-cli v1.4.3
grunt v1.4.1
Install path: C:\<my project path>\node_modules\grunt
Available tasks: mytask
Available options: --help -h --base -b --no-color --gruntfile --debug -d --stack --force -f --tasks --npm --no-write --verbose -v --version -V --completion --preload -p
I did a quick test and turns out you can stick your parameters anywhere in arguments, before or after your task.
But version
is reserved for grunt and if added will produce the output you're seeing, so rename it to something that's not in grunt --help
and it should work 👍
Ah, of course; thanks! I eventually went a different route, but I will bear this in mind going forward!
Hi!
I am trying to use grunt with the plugin as specified in https://github.com/node-gradle/gradle-node-plugin/blob/master/docs/faq.md.
I would like to pass the project version from my gradle file to the gruntfile (using the grunt option mechanism https://gruntjs.com/api/grunt.option).
I can't get this to work; I have tried:
but this results in:
if I try:
The build doesn't fail, but grunt also does not execute correctly:
I'm sure it's something simple, but would love some pointers!