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

Accept parameters for aliases #139

Open
jeandat opened this issue Nov 12, 2015 · 9 comments
Open

Accept parameters for aliases #139

jeandat opened this issue Nov 12, 2015 · 9 comments

Comments

@jeandat
Copy link

jeandat commented Nov 12, 2015

I think it could be useful to allow parameters for aliases.

Maybe something like that. In this example, myAlias receive two parameters from command line named user and pwd whose value is respectively aUser and aPwd. They are used by task1.

aliases.yaml

myAlias:
  - task1:aTarget:$user:$pwd
  - task2

command line

grunt myAlias:aUser:aPwd
@SolomoN-ua
Copy link
Collaborator

Hi @jdat82, interesting idea I will think about it, thx.

@JeffWeim
Copy link

JeffWeim commented Jan 6, 2016

This would prove useful, especially if you could establish in your Gruntfile.js something like:

    'data': {
        'myData': grunt.option('foo') || 'bar'
    }

and then in your aliases.json file something like:

    "myAlias": [
        "sass:compileSass --foo=xzy"
    ]

@kohlmannj
Copy link

FWIW, would also like to see this enhancement under consideration.

@jshemas
Copy link

jshemas commented Mar 14, 2016

Would love this!

@luketeaford
Copy link

This would be perfect for me!

@ksotello
Copy link

Yeah this looks awesome

@jshemas
Copy link

jshemas commented Mar 14, 2016

@jgallen23 Any chance you can look into this? I would be eternally grateful!

@jgallen23
Copy link
Member

This sounds like a great feature. I'd accept a PR if anybody wants to take a shot at it.

@yadimon
Copy link

yadimon commented Jun 27, 2017

as a workaround, i used alias this, to run 2 tasks, and the first one with passed parameter:

'test': {
  description: 'starts test file',
  tasks: function(fileName) {
    grunt.task.run('run-test:' + fileName);
    grunt.task.run('open:testReport');
  }
},

now i can run it like test:parameter

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

9 participants