Skip to content
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

Sending arguments to hubbed "basic" tasks #42

Open
davidgovea opened this issue Mar 19, 2014 · 3 comments
Open

Sending arguments to hubbed "basic" tasks #42

davidgovea opened this issue Mar 19, 2014 · 3 comments

Comments

@davidgovea
Copy link

In a child project, I have a "Basic task" that accepts an argument. From within the child project, I can run:

grunt task:argument

From the "parent" project, I would like to issue a command like:

grunt hub:child:task:argument

but this ends up running the [task, argument] tasks on the child project -> "Task 'argument' not found"

I have found a workaround:

grunt hub:child:'task\:argument'

which ends up running task:argument on the child, but this feels kinda hacky.

Since the 'child' gruntfile is never loaded by grunt-hub, it does not seem feasible to check whether the task exists beforehand - so what is the best option here? A character other than ":"? Perhaps even just documenting this workaround?

Thanks!

@shama
Copy link
Owner

shama commented Mar 19, 2014

The solution you found grunt hub:child:'task\:argument' is your best bet. I don't really want to implement a cli convention outside of default grunt at this time.

+1 to documenting this.

@davidgovea
Copy link
Author

Great - I thought as much. Who knows what will happen on windows, though... :trollface:
I can do a PR on the readme for this

Thanks for the quick response

@mrfelton
Copy link

+1 for this. the workaround mentioned above works if you are running commands directly from the command line, but not if you are including tasks within registerTask() within Gruntfile.js. ie, you can't do this:

  grunt.registerTask('test_e2e', 'Run e2e tests against all applications.', [
    'hub:client_app:test:e2e',
    'hub:client_docs:test:e2e'
  ]);

or this:

  grunt.registerTask('test_e2e', 'Run e2e tests against all applications.', [
    "hub:client_app:'test\:e2e'",
    "hub:client_docs:'test\:e2e'"
  ]);

or any similar variant that I have tried.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants