Keep symbolic links when copying node_modules or we run into problems because they no longer know which module they belong to.

This commit is contained in:
Simo Kinnunen
2014-07-30 17:49:39 +09:00
parent 05549ce32a
commit 93973dc953
2 changed files with 10 additions and 2 deletions

View File

@@ -32,7 +32,7 @@ if test -d $build_dir/node_modules; then
npm rebuild 2>&1 | indent
elif test -d $cache_dir/node/node_modules; then
status "Restoring node_modules directory from cache"
cp -r $cache_dir/node/node_modules $build_dir/
cp_keep_links -R $cache_dir/node/node_modules $build_dir/
status "Pruning cached dependencies not specified in package.json"
npm prune 2>&1 | indent
@@ -70,7 +70,7 @@ mkdir -p $cache_dir/node
# If app has a node_modules directory, cache it.
if test -d $build_dir/node_modules; then
status "Caching node_modules directory for future builds"
cp -r $build_dir/node_modules $cache_dir/node
cp_keep_links -R $build_dir/node_modules $cache_dir/node
fi
# Copy goodies to the cache