I work on a Node.js project and often run a command in bash which looks like this:
path/to/file/1 --flags path/to/file/2 --flags somecommand
The command is mostly the same, I only change path/to/file/2 all the time. Now I would like to implement a script into my package.json file so I can run something like this:
npm run scriptcommand path/to/file/2
I don't know much about bash but I feel like I would need something like this in my package.json file:
{
"scripts": {
"scriptcommand": "path/to/file/1 --flags $1 --flags somecommand"
}
}
Is there any posibility to substitute path/to/file/2 with a variable like in the above example so I can set a different path on every run?