Skip to content

Commit

Permalink
Update "cross-env" to the latest version, which includes a fix for c…
Browse files Browse the repository at this point in the history
…ommands in Windows with undefined env variables

Fixes #16452
Closes #19084

The latest version of `cross-env` (`5.1.1`) includes a fix to #16452.
The fix is: kentcdodds/cross-env#149
Now the behaviour of commands like `cross-env node $UNDEFINED_VAR index.js` is expanding the variable
to the empty string, both in Windows and in UNIX.

To get the new version of `cross-env` working, I had to change all `cross-env` commands to `cross-env-shell`,
as this was a breaking change on `cross-env@5`.

To test: run `npm start` on a Windows `cmd.exe` shell, check that it works.

cc/ @Viper007Bond @withinboredom
  • Loading branch information
Daniel Rey Lopez authored and DanReyLop committed Nov 17, 2017
1 parent d87983f commit 1cbb54c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"copy-webpack-plugin": "4.0.1",
"create-react-class": "15.6.2",
"creditcards": "2.1.2",
"cross-env": "4.0.0",
"cross-env": "5.1.1",
"d3-array": "1.2.0",
"d3-scale": "1.0.6",
"d3-selection": "1.1.0",
Expand Down Expand Up @@ -166,7 +166,7 @@
"npm": "5.5.1"
},
"scripts": {
"preanalyze-bundles": "cross-env WEBPACK_OUTPUT_JSON=1 CALYPSO_ENV=production npm run -s env -- node --max_old_space_size=8192 ./node_modules/.bin/webpack --config webpack.config.js --profile --json > stats.json",
"preanalyze-bundles": "cross-env-shell WEBPACK_OUTPUT_JSON=1 CALYPSO_ENV=production npm run -s env -- node --max_old_space_size=8192 ./node_modules/.bin/webpack --config webpack.config.js --profile --json > stats.json",
"analyze-bundles": "webpack-bundle-analyzer stats.json public -h 0.0.0.0 -p 9898",
"analyze-css": "node bin/analyze-css.js",
"autoprefixer": "postcss -r --use autoprefixer",
Expand Down Expand Up @@ -199,10 +199,10 @@
"clean:public": "npm run -s rm -- public .css .css.map .js .js.map && npm run -s rm -- public/sections .css .css.map && npm run -s rm -- public/sections-rtl .css .css.map",
"codemod": "node bin/codemods/run",
"predashboard": "npm run -s install-if-deps-outdated",
"dashboard": "cross-env DASHBOARD=1 webpack-dashboard -- npm start",
"dashboard": "cross-env-shell DASHBOARD=1 webpack-dashboard -- npm start",
"distclean": "npm run -s clean && npm run -s rm -- node_modules",
"docker": "docker run -it --name wp-calypso --rm -p 80:3000 -e NODE_ENV=wpcalypso -e CALYPSO_ENV=wpcalypso wp-calypso",
"env": "cross-env NODE_PATH=$NODE_PATH:server:client:.",
"env": "cross-env-shell NODE_PATH=$NODE_PATH:server:client:.",
"eslint-branch": "node bin/eslint-branch.js",
"install-if-deps-outdated": "node bin/install-if-deps-outdated.js",
"install-if-no-packages": "node bin/install-if-no-packages.js",
Expand All @@ -218,21 +218,21 @@
"postshrinkwrap": "node bin/trim-shrinkwrap.js && touch node_modules",
"prestart": "npm run -s install-if-deps-outdated && node bin/welcome.js && ( check-node-version --package || exit 0 )",
"start": "npm run -s build",
"poststart": "npm run -s env -- cross-env node $NODE_ARGS build/bundle.js",
"poststart": "npm run -s env -- cross-env-shell node $NODE_ARGS build/bundle.js",
"reformat-files": "node bin/reformat-files.js",
"pretest": "npm run -s install-if-deps-outdated",
"test": "run-s -s test-client test-server",
"pretest-client": "npm run -s pretest",
"test-client": "jest -c=test/client/jest.config.json",
"test-client:ci": "cross-env TEST_REPORT_FILENAME=./test-results-client.xml jest -c=test/client/jest.config.ci.js -w=2",
"test-client:ci": "cross-env-shell TEST_REPORT_FILENAME=./test-results-client.xml jest -c=test/client/jest.config.ci.js -w=2",
"test-client:watch": "npm run -s test-client -- --watch",
"pretest-integration": "npm run -s pretest",
"test-integration": "jest -c=test/integration/jest.config.json",
"test-integration:ci": "cross-env TEST_REPORT_FILENAME=./test-results-integration.xml jest -c=test/integration/jest.config.ci.js -w=2",
"test-integration:ci": "cross-env-shell TEST_REPORT_FILENAME=./test-results-integration.xml jest -c=test/integration/jest.config.ci.js -w=2",
"test-integration:watch": "npm run -s test-integration -- --watch",
"pretest-server": "npm run -s pretest",
"test-server": "jest -c=test/server/jest.config.json",
"test-server:ci": "cross-env TEST_REPORT_FILENAME=./test-results-server.xml jest -c=test/server/jest.config.ci.js -w=2",
"test-server:ci": "cross-env-shell TEST_REPORT_FILENAME=./test-results-server.xml jest -c=test/server/jest.config.ci.js -w=2",
"test-server:coverage": "npm run -s test-server -- --coverage",
"test-server:watch": "npm run -s test-server -- --watch",
"translate": "i18n-calypso --format pot --output-file ./calypso-strings.pot -e date \"**/*.js\" \"**/*.jsx\" \"!build/**\" \"!node_modules/**\" \"!public/**\" \"!client/extensions/**\"",
Expand Down

0 comments on commit 1cbb54c

Please sign in to comment.