chore(grunt): blow away cached node_modules when npm-shrinkwrap.json changes
this replicates the travis setup in grunt from the previous commit the reason why we duplicate this rather than having just a single place for this code is so that we can individually time the actions on travis
This commit is contained in:
@@ -46,6 +46,7 @@ install:
|
||||
# Log HTTP requests
|
||||
- npm config set loglevel http
|
||||
- npm install -g npm@2.5
|
||||
# Instal npm dependcies and ensure that npm cache is not stale (these steps are replicated in lib/grunt/utils.js)
|
||||
- diff -q npm-shrinkwrap.json node_modules/npm-shrinkwrap.cached.json; if [[ $? -ne 0 ]]; then echo 'Shrinkwrap changed! Blowing away node_modules.'; rm -rf node_modules; fi
|
||||
- time npm install
|
||||
- cp npm-shrinkwrap.json node_modules/npm-shrinkwrap.cached.json
|
||||
|
||||
@@ -16,7 +16,10 @@ module.exports = {
|
||||
|
||||
init: function() {
|
||||
if (!process.env.TRAVIS) {
|
||||
// replicated from .travis.yaml
|
||||
shell.exec("diff -q npm-shrinkwrap.json node_modules/npm-shrinkwrap.cached.json; if [[ $? -ne 0 ]]; then echo 'Shrinkwrap changed! Blowing away node_modules.'; rm -rf node_modules; fi");
|
||||
shell.exec('npm install');
|
||||
shell.exec('cp npm-shrinkwrap.json node_modules/npm-shrinkwrap.cached.json');
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user