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:
Igor Minar
2015-02-21 12:08:45 -08:00
parent f497358df1
commit a773f89bc9
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -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
+3
View File
@@ -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');
}
},