This is a slightly different question than this thread.
I'm looking for the best way to pass command line arguments into my package.json file and npm scripts. I'm not interested in passing it, ultimately, into a script.
There are questions about how to do this but none specifically addressing the issues with trying to use a bash function in the package.json
My npm script is:
"Gocommit": "f() { cd dev; git add -A; git commit -m '$1'; git push;}; f"
I want to be able to write..
npm run Gocommit message
or
npm run Gocommit -- message
And have it use my flag or argument as the commit message.
But it just keeps using $1
Where did I go wrong?