Let's say I have the following in a file called print-last-arg.js
:
console.log(process.argv[process.argv.length-1])
And the following scripts in my package.json
:
"scripts": {
"print_a": "node print-last-arg.js",
"print_b": "npm run print_a"
}
When I run npm run print_a -- --foo=bar
, I get --foo=bar
as expected.
However, npm run print_b -- --foo=bar
gives me no output.
How do I pass the CLI arguments from print_b
to print_a
?