Accessing variable with $ does not work on windows with cross-env-shell
raDiesle opened this issue · comments
D.A. commented
cross-env
version: 5.2.1node
version: 10.16.0npm
version: 6.9.0
On Windows 10, the example from documentation does not print variable by using $GREET, but %GREET% works:
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo "Error: no test specified" && exit 1",
"parentScript": "cross-env GREET="Joe" npm run childScript",
"childScript": "cross-env-shell "echo Hello $GREET""
},
"author": "",
"license": "ISC",
"dependencies": {
"cross-env": "5.2.1"
}
}
By performing
npm run parentScript
In .npmrc PowerShell is configured
D.A. commented
I figured out by switching PowerShell back to default CMD, it works!
I guess documentation should be updated or to support PowerShell.
Kent C. Dodds commented
Sorry for not responding to this earlier. It's been long enough that I'm going to close this issue. If you're still experiencing problems, please open a new issue.