Commit ef57f219 authored by zeke's avatar zeke

bring caching back

parent b8a6635f
......@@ -62,31 +62,30 @@ cache_store_dir="$cache_dir/node_modules/$node_version"
cache_target_dir="$build_dir/node_modules"
# Restore node_modules from cache, if present
# if [ -d $cache_store_dir ]; then
# status "Restoring node_modules cache"
# if [ -d $cache_target_dir ]; then
# cp -r $cache_store_dir/* $cache_target_dir/
# else
# cp -r $cache_store_dir $cache_target_dir
# fi
# status "Pruning any unused dependencies"
# npm prune
# fi
cd $build_dir
if [ -d $cache_store_dir ]; then
status "Restoring node_modules cache"
if [ -d $cache_target_dir ]; then
cp -r $cache_store_dir/* $cache_target_dir/
else
cp -r $cache_store_dir $cache_target_dir
fi
status "Pruning any unused dependencies"
npm prune
fi
# Install dependencies
status "Installing dependencies"
cd $build_dir
npm install --production
npm rebuild
# Cache node_modules for future builds
# if [ -d $cache_target_dir ]; then
# status "Caching node_modules for future builds"
# rm -rf $cache_store_dir
# mkdir -p $(dirname $cache_store_dir)
# cp -r $cache_target_dir $cache_store_dir
# fi
if [ -d $cache_target_dir ]; then
status "Caching node_modules for future builds"
rm -rf $cache_store_dir
mkdir -p $(dirname $cache_store_dir)
cp -r $cache_target_dir $cache_store_dir
fi
# Update the PATH
status "Building runtime environment"
......
......@@ -51,11 +51,11 @@ testProfileCreated() {
assertCapturedSuccess
}
# testNodeModulesCached() {
# cache=$(mktmpdir)
# compile "node-modules-caching" $cache
# assertEquals "1" "$(ls -1 $cache/node_modules/0.10.17 | wc -l)"
# }
testNodeModulesCached() {
cache=$(mktmpdir)
compile "node-modules-caching" $cache
assertEquals "1" "$(ls -1 $cache/node_modules/0.10.18 | wc -l)"
}
## utils ########################################
......
......@@ -7,8 +7,7 @@
"url" : "http://github.com/example/example.git"
},
"engines": {
"node": "0.10.15",
"npm": "1.3.5"
"node": "0.10.18"
},
"dependencies": {
"express": "latest"
......
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