Travis: Simplify and clean up gulp invocation #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The even better news is that you don't need
npm install -g gulp
, because Gulp is already a devDependency which are installed by runningnpm install
.Now granted, when running
npm install
, Gulp will only be installed locally, not globally. But, all npm script contexts use the local node_modules/.bin by default in their PATH (which is documented,stable and intended behaviour). As such, 'gulp' works fine from `npm test.
I won't change the README.md documentation, as it is still useful to have Gulp installed globally in order to conveniently run other gulp tasks, but at least for the minimum of running the tests
from
npm test
, and for the purposes of Travis CI, it does not need to be installed via .travis.yml.This also has the benefit of making Travis CI actually use the version of Gulp specified in package.json, instead of the variable latest.
I've also changed
npm test
fromgulp travis --verbose
togulp --verbose
because it seems like this was an unintentional remnant. Given that Travis CI was previously not usingnpm test
, this command was not used by Travis. And the default==travis anyway in the current Gulpfile, but it seems better to invoke it through the default than through travis, given this will be used by both travis and locally during development. If in the future such variation is needed again, it is typically recommended to make the vary within the Gulpfile (e.g. change the default based onprocess.env.CI
, orprocess.env.TRAVIS
[1]).[1] https://docs.travis-ci.com/user/environment-variables/