Commit f1b19542 authored by Hunter Loftis's avatar Hunter Loftis

Merge pull request #238 from heroku/fix-prebuild-should-skip-prune

Fix prebuild should skip prune
parents 2e2f28b7 f214931f
......@@ -75,8 +75,8 @@ save_cache_directories() {
for cachepath in ${@:3}; do
if [ -e "$build_dir/$cachepath" ]; then
echo "- $cachepath"
mkdir -p $(dirname "$cache_dir/node/$cachepath")
ln -s "$build_dir/$cachepath" "$cache_dir/node/$cachepath"
mkdir -p "$cache_dir/node/$cachepath"
cp -a "$build_dir/$cachepath" $(dirname "$cache_dir/node/$cachepath")
else
echo "- $cachepath (nothing to cache)"
fi
......
......@@ -21,8 +21,6 @@ rebuild_node_modules() {
if [ -e $build_dir/package.json ]; then
cd $build_dir
echo "Pruning any extraneous modules"
npm prune --unsafe-perm --userconfig $build_dir/.npmrc 2>&1
echo "Rebuilding any native modules"
npm rebuild 2>&1
if [ -e $build_dir/npm-shrinkwrap.json ]; then
......
#!/usr/bin/env bash
# See README.md for info on running these tests.
testModulesCheckedIn() {
cache=$(mktmpdir)
compile "modules-checked-in" $cache
assertCapturedSuccess
compile "modules-checked-in" $cache
assertCaptured "Prebuild detected"
assertCaptured "Rebuilding any native modules"
assertCaptured "(preinstall script)"
assertCaptured "Installing any new modules"
assertCaptured "(postinstall script)"
assertNotCaptured "Pruning any extraneous modules"
assertCapturedSuccess
}
testDisableCache() {
cache=$(mktmpdir)
env_dir=$(mktmpdir)
......@@ -235,20 +250,6 @@ testBuildWithUserCacheDirectoriesCamel() {
assertCapturedSuccess
}
testModulesCheckedIn() {
cache=$(mktmpdir)
compile "modules-checked-in" $cache
assertCapturedSuccess
compile "modules-checked-in" $cache
assertCaptured "Prebuild detected"
assertCaptured "Rebuilding any native modules"
assertCaptured "(preinstall script)"
assertCaptured "Installing any new modules"
assertCaptured "(postinstall script)"
assertCapturedSuccess
}
testUserConfig() {
compile "userconfig"
assertCaptured "www.google.com"
......
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