From 907add6acc1f5cba2ecddf78fb403f427e2484ff Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 10 Aug 2016 11:10:12 -0700 Subject: [PATCH] Have travis cache the npm cache instead of node_modules. --- .travis.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index b432192ef..a22462c99 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ node_js: - "6" cache: directories: - - node_modules + - $HOME/.npm - travis_phantomjs env: global: @@ -73,17 +73,10 @@ before_install: done fi - # Move lodash-cli node_modules before pruning. - - "mkdir -p ./tmp/lodash-cli/node_modules" - - "mv ./node_modules/lodash-cli/node_modules ./tmp/lodash-cli/node_modules || true" - - "npm prune" - - # Restore lodash-cli. + # Use lodash-cli from GitHub. - "git clone --depth=10 --branch=master git://github.com/lodash/lodash-cli ./node_modules/lodash-cli" - - "mv ./tmp/lodash-cli/node_modules ./node_modules/lodash-cli/node_modules || true" - - "cd ./node_modules/lodash-cli && npm prune" - - "mkdir -p ./node_modules/lodash && cd $_ && cp ../../../../lodash.js ./lodash.js && cp ../../../../package.json ./package.json" - - "cd ../../ && rm -rf .git && npm i --production && cd ../../" + - "mkdir -p ./node_modules/lodash-cli/node_modules/lodash && cd $_ && cp ../../../../lodash.js ./lodash.js && cp ../../../../package.json ./package.json" + - "cd ../../ && npm i --production && cd ../../" script: # Detect code coverage.