Commit cecfca31 authored by Hunter Loftis's avatar Hunter Loftis

test and implementation for skipping replacement of npm if requested version...

test and implementation for skipping replacement of npm if requested version matches bundled version
parent 6211e056
......@@ -110,8 +110,12 @@ if [ "$npm_engine" != "" ]; then
info "Resolving npm version ${npm_engine} via semver.io..."
npm_engine=$(curl --silent --get --data-urlencode "range=${npm_engine}" https://semver.herokuapp.com/npm/resolve)
fi
info "Downloading and installing npm $npm_engine (replacing version `npm --version`)..."
npm install --quiet -g npm@$npm_engine > /dev/null 2>&1 | indent
if [[ `npm --version` == "$npm_engine" ]]; then
info "Version `npm --version` already installed"
else
info "Downloading and installing npm $npm_engine (replacing version `npm --version`)..."
npm install --quiet -g npm@$npm_engine > /dev/null 2>&1 | indent
fi
fi
# Run subsequent commands from the build directory
......
......@@ -54,6 +54,12 @@ testOldNpm() {
assertCapturedSuccess
}
testSameNpm() {
compile "same-npm"
assertCaptured "Version 1.4.28 already installed"
assertCapturedSuccess
}
testFailingBuild() {
compile "failing-build"
assertCaptured "Build failed"
......
......@@ -7,7 +7,7 @@
"url" : "http://github.com/example/example.git"
},
"engines": {
"node": "0.10.33",
"node": "0.10.12",
"npm": "1.4.x"
}
}
{
"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"
},
"dependencies": {
"hashish": "*"
},
"engines": {
"node": "0.10.33",
"npm": "1.4.28"
},
"scripts": {
"start": "node server.js"
}
}
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