简体   繁体   中英

How to pass argument to npm script with AND operator

I have one npm script:

 scripts: { "deploy": "npm run build && ./deploy.sh" } 

we can pass an argument to the script: npm run deploy -- --env=prod

but the problem is the command before the AND operator didn't get the argument injected, is there a way to pass the argument with the && operator?

I am expecting a way like:

 scripts: { "start": "npm run build -- arg[0] && ./deploy.sh" } 

or any correct or better way to get there, any suggestion will be appreciated.

我尝试这种方式,它接缝工作

"start":"npm run build -- {{process.argv}} && ./deploy.sh"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM