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

How to pass command line argument to npm task in node application #359

Open
vickyru opened this issue Dec 4, 2019 · 2 comments
Open

How to pass command line argument to npm task in node application #359

vickyru opened this issue Dec 4, 2019 · 2 comments

Comments

@vickyru
Copy link

vickyru commented Dec 4, 2019

I want to write single npm task which can accept multiple command line arguments
// build.gradle

task npmRunTestSuite(type: NpmTask) {
// args = ['run', 'regression-test']
}

now from command prompt

.\gradlew npmRunTestSuite --args="run","'regression-test"

or

.\gradlew npmRunTestSuite --args="run","'smoke-test"

I know i can write two different task to achieve it but want to avoid it. Its urgent please do help me out.

@vickyru
Copy link
Author

vickyru commented Dec 4, 2019

@srs Any idea?

@deepy
Copy link

deepy commented Jan 16, 2020

You don't even need to write tasks for this the gradle rule exists for these specific cases see the documentation: especially the underscore part

You just need to do .\gradlew npm_run_smoke-test

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

2 participants