Unverified Commit 9d563898 authored by Jeremy Morrell's avatar Jeremy Morrell Committed by GitHub

Add new Build header (#625)

Currently the `build` step gets jumbled up with the `npm install` step. Let's cleanly separate the two
parent b7028b35
......@@ -257,6 +257,13 @@ build_dependencies() {
mtime "modules.time.cache.$cache_status" "${start}"
if [[ "$NEW_BUILD_SCRIPT_BEHAVIOR" = true ]]; then
if $YARN; then
header "Build"
else
# npm already prints a new line after the install
# without skipping the newline there's an awkward double line break
header_skip_newline "Build"
fi
mcount "build-script.new-behavior"
run_build_script "$BUILD_DIR"
else
......
......@@ -28,6 +28,10 @@ header() {
echo "-----> $*" || true
}
header_skip_newline() {
echo "-----> $*" || true
}
error() {
echo " ! $*" >&2 || true
echo "" || true
......
A fake README, to keep npm from polluting stderr.
\ No newline at end of file
{
"name": "node-buildpack-test-app",
"version": "0.0.1",
"description": "node buildpack integration test app",
"repository" : {
"type" : "git",
"url" : "http://github.com/example/example.git"
},
"scripts" : {
"build" : "echo build hook message"
},
"heroku-run-build-script": true,
"license": "MIT"
}
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
......@@ -72,6 +72,13 @@ testBuildScriptOptIn() {
assertCapturedSuccess
}
testBuildScriptOptInYarn() {
compile "build-script-opt-in-yarn"
assertCaptured "Running build (yarn)"
assertCaptured "build hook message"
assertCapturedSuccess
}
testPreferEmptyHerokuPostbuildOverBuild() {
compile "empty-heroku-postbuild"
assertCaptured "Detected both \"build\" and \"heroku-postbuild\" scripts"
......
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