-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run parametrized task using grunt.task.run(taskname) #235
Comments
To put parameters into task.run, use the A simple way I found to implement it is to access the
Thus to pass in the parameters, you could do |
Contrary to the introduction, the example above does not use any I thought you could pass arguments onto tasks via That would mean you can't use |
I looked at Grunt API docs but couldn't find a way to run a parametrized task using grunt.task.run(taskname). In this case, the taskname parameter may have n number of arguements.
I have a simple task which accepts a parameter and prints the message on console:
I call the above task using below task which validates the task and if task exists then it runs it:
Now from command line, I am passing 'hello' task as parameter to 'validateandruntask' but I am not been able to pass the parameter to 'hello' task from command line:
This is what I tried on command line but it didn't work:
grunt validateandruntask:hello=foo
grunt validateandruntask:hello:param=name
Is this supported as part of grunt.task.run API or does application need to take care of this by passing additional parameter for child tasks to parent task (in this case, validateandruntask) which will run parametrized tasks?
The text was updated successfully, but these errors were encountered: