Commit bdab3378 authored by zeke's avatar zeke

only prune when node_modules directory is restored from cache. Fixes #75

parent e6703624
...@@ -62,15 +62,15 @@ if test -d $build_dir/node_modules; then ...@@ -62,15 +62,15 @@ if test -d $build_dir/node_modules; then
elif test -d $cache_dir/node_modules; then elif test -d $cache_dir/node_modules; then
status "Restoring node_modules directory from cache" status "Restoring node_modules directory from cache"
cp -r $cache_dir/node_modules $build_dir/ cp -r $cache_dir/node_modules $build_dir/
status "Pruning cached dependencies not specified in package.json"
npm prune 2>&1 | indent
fi fi
# Make npm output to STDOUT instead of its default STDERR # Make npm output to STDOUT instead of its default STDERR
status "Installing dependencies" status "Installing dependencies"
npm install --userconfig $build_dir/.npmrc --production 2>&1 | indent npm install --userconfig $build_dir/.npmrc --production 2>&1 | indent
status "Pruning dependencies not specified in package.json"
npm prune 2>&1 | indent
status "Caching node_modules directory for future builds" status "Caching node_modules directory for future builds"
rm -rf $cache_dir rm -rf $cache_dir
mkdir -p $cache_dir mkdir -p $cache_dir
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment