Commit 225646aa authored by Hunter Loftis's avatar Hunter Loftis

add more verbose success output

parent 3717a3e2
build_failed() {
echo ""
echo "Build failed."
echo ""
}
error() { error() {
echo " ! $*" >&2 echo " ! $*" >&2
exit 1 exit 1
......
...@@ -29,6 +29,8 @@ unset GIT_DIR ...@@ -29,6 +29,8 @@ unset GIT_DIR
mkdir -p $heroku_dir/node mkdir -p $heroku_dir/node
echo "" > $logfile echo "" > $logfile
trap build_failed ERR
# Load config vars into environment; start with defaults # Load config vars into environment; start with defaults
export NPM_CONFIG_PRODUCTION=true export NPM_CONFIG_PRODUCTION=true
export BUILD_CLEAN=false export BUILD_CLEAN=false
...@@ -110,7 +112,7 @@ if [ "$npm_engine" != "" ]; then ...@@ -110,7 +112,7 @@ if [ "$npm_engine" != "" ]; then
npm_engine=$(curl --silent --get --data-urlencode "range=${npm_engine}" https://semver.io/npm/resolve) npm_engine=$(curl --silent --get --data-urlencode "range=${npm_engine}" https://semver.io/npm/resolve)
fi fi
status "Downloading and installing npm $npm_engine (replacing version `npm --version`)..." status "Downloading and installing npm $npm_engine (replacing version `npm --version`)..."
npm install -g npm@$npm_engine npm install --quiet -g npm@$npm_engine 2>&1
fi fi
# Run subsequent commands from the build directory # Run subsequent commands from the build directory
...@@ -139,22 +141,22 @@ if [ "$modules_source" == "" ]; then ...@@ -139,22 +141,22 @@ if [ "$modules_source" == "" ]; then
elif [ $modules_source == "prebuilt" ]; then elif [ $modules_source == "prebuilt" ]; then
status "Rebuilding any native modules for this architecture" status "Rebuilding any native modules for this architecture"
npm rebuild npm rebuild 2>&1
elif ! $BUILD_CLEAN && ! $cache_busted; then elif ! $BUILD_CLEAN && ! $cache_busted; then
status "Restoring node modules from cache" status "Restoring node modules from cache"
cp -r $cache_dir/node/node_modules $build_dir/ cp -r $cache_dir/node/node_modules $build_dir/
status "Pruning unused dependencies" status "Pruning unused dependencies"
npm prune npm prune 2>&1
status "Installing any new modules" status "Installing any new modules"
npm install --userconfig $build_dir/.npmrc npm install --quiet --userconfig $build_dir/.npmrc 2>&1
else else
status "Installing node modules" status "Installing node modules"
touch $build_dir/.npmrc touch $build_dir/.npmrc
npm install --userconfig $build_dir/.npmrc npm install --quiet --userconfig $build_dir/.npmrc 2>&1
status "Deduping dependency tree" status "Deduping dependency tree"
npm dedupe npm dedupe 2>&1
fi fi
####### Create a Procfile if possible ####### Create a Procfile if possible
...@@ -208,4 +210,4 @@ fi ...@@ -208,4 +210,4 @@ fi
# Show the final dependency tree # Show the final dependency tree
echo "" echo ""
npm ls --depth=0 | indent npm ls --depth=0 2>&1
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