This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.
npm run removes quotes from given parameters #7743
Closed
Description
I'm using npm as a build tool and ran into the following issue with npm run
and quoted parameters.
This is the interesting part of the "scripts" section in my package.json:
"scripts": {
"test": "mochify",
"cover": "npm run test -- --plugin [ mochify-istanbul --report cobertura --exclude '**/*.mustache' ]"
}
Running npm run cover
prints this:
> npm run test -- --plugin [ mochify-istanbul --report cobertura --exclude '**/*.mustache' ]
...
> mochify --plugin [ mochify-istanbul --report cobertura --exclude **/*.mustache ]
You can see that **/*.mustache
is quoted on the first line, but the quotes are removed on the second line. This causes the script to fail because I have to pass the glob expression as a plain string.
If I change the cover script to this:
"cover": "mochify --plugin [ mochify-istanbul --report cobertura --exclude '**/*.mustache' ]"
... calling npm run cover
works fine and npm prints the quotes as expected:
> mochify --plugin [ mochify-istanbul --report cobertura --exclude '**/*.mustache' ]
Thanks for looking into it!
Metadata
Metadata
Assignees
Labels
No labels
Activity