Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting env var assignments on Windows #316

Merged
merged 8 commits into from
Jul 3, 2016
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
"prebuild:dist": "rimraf dist",
"build:dist": "babel src -d dist",
"build:docs": "gulp docs",
"predeploy:docs": "NODE_ENV=production npm run build:docs",
"predeploy:docs": "cross-env NODE_ENV=production npm run build:docs",
"deploy:docs": "gh-pages -d docs/build -m 'deploy docs [ci skip]'",
"lint": "eslint .",
"lint:fix": "npm run lint -- --fix",
"lint:watch": "watch 'npm run lint --silent' docs gulp src test",
"prepublish": "NODE_ENV=production npm run build:dist",
"prepublish": "cross-env NODE_ENV=production npm run build:dist",
"release:major": "ta-script npm/release.sh major",
"release:minor": "ta-script npm/release.sh minor",
"release:patch": "ta-script npm/release.sh patch",
"start": "npm run docs",
"start:local-modules": "npm run docs -- --local-modules",
"pretest": "gulp dll",
"test": "NODE_ENV=test babel-node $(npm bin)/karma start build/karma.conf.babel.js",
"test": "cross-env NODE_ENV=test babel-node node_modules/karma start build/karma.conf.babel.js",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be node_modules/.bin/karma.

Details:
When you npm install packages that come with executables, they are placed in node_modules/.bin. You can get the absolute path to the npm bin with the command npm bin. NPM also adds this directory to your $PATH when you npm run ... scripts. This way you can execute scripts that you have installed. The $(npm bin) syntax is command substitution. It places the output of that command inline in another command. So, we were placing the absolute path to the npm bin directory just before /karma.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for explaining that to me. I learned something new!

"test:watch": "npm run test --silent -- --watch"
},
"repository": {
Expand Down Expand Up @@ -63,6 +63,7 @@
"chai": "^3.3.0",
"chai-enzyme": "^0.4.1",
"connect-history-api-fallback": "^1.2.0",
"cross-env": "^1.0.8",
"css-loader": "^0.23.1",
"del": "^2.0.2",
"dirty-chai": "^1.2.2",
Expand Down