Commit b879e848 authored by Hunter Loftis's avatar Hunter Loftis

Merge pull request #278 from heroku/multiple-runs

test and implementation for compiling the same directory multiple times
parents c3354498 b4f58f47
# Node.js Buildpack Changelog
## Pending
Enables compiling the same directory multiple times
## v86 (2015-10-08)
Fixes piped output buffering issues
......
......@@ -20,6 +20,7 @@ install_nodejs() {
local download_url="http://s3pository.heroku.com/node/v$version/node-v$version-$os-$cpu.tar.gz"
curl "$download_url" --silent --fail -o /tmp/node.tar.gz || (echo "Unable to download node $version; does it exist?" && false)
tar xzf /tmp/node.tar.gz -C /tmp
rm -rf $dir/*
mv /tmp/node-v$version-$os-$cpu/* $dir
chmod +x $dir/bin/*
}
......
#!/usr/bin/env bash
# See README.md for info on running these tests.
testMultipleRuns() {
local compileDir=$(mktmpdir)
local cacheDir=$(mktmpdir)
cp -a test/fixtures/stable-node/. ${compileDir}
compileDir "$compileDir" "$cacheDir"
assertCapturedSuccess
compileDir "$compileDir" "$cacheDir"
assertCapturedSuccess
}
testDisableCache() {
cache=$(mktmpdir)
env_dir=$(mktmpdir)
......@@ -497,6 +508,18 @@ compile() {
capture ${bp_dir}/bin/compile ${compile_dir} ${2:-$(mktmpdir)} $3
}
compileDir() {
default_process_types_cleanup
local bp_dir=$(mktmpdir)
local compile_dir=${1:-$(mktmpdir)}
local cache_dir=${2:-$(mktmpdir)}
local env_dir=$3
cp -a $(pwd)/* ${bp_dir}
capture ${bp_dir}/bin/compile ${compile_dir} ${cache_dir} ${env_dir}
}
release() {
bp_dir=$(mktmpdir)
cp -a $(pwd)/* ${bp_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