Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

choose default version using semver

  • Loading branch information...
commit 90d7de70071b2afca1724dab4d4209231771c4f2 1 parent 5271c2a
@zeke zeke authored
Showing with 10 additions and 11 deletions.
  1. +8 −9 bin/compile
  2. +2 −2 bin/test
View
17 bin/compile
@@ -60,15 +60,17 @@ function resolve_version() {
requested_version="$2"
default_version="$3"
+ args=""
+ for version in $available_versions; do args="${args} -v \"${version}\""; done
+
if [ "$2" == "" ]; then
- echo $3
+ args="${args} -r \"${default_version}\"";
else
- args=""
- for version in $available_versions; do args="${args} -v \"${version}\""; done
- for version in $requested_version; do args="${args} -r \"${version}\""; done
- evaluated_version=$(eval $bootstrap_node/bin/node $LP_DIR/vendor/node-semver/bin/semver ${args} || echo "")
- echo "$evaluated_version" | tail -n 1
+ args="${args} -r \"${requested_version}\"";
fi
+
+ evaluated_versions=$(eval $bootstrap_node/bin/node $LP_DIR/vendor/node-semver/bin/semver ${args} || echo "")
+ echo "$evaluated_versions" | tail -n 1
}
function package_engine_version() {
@@ -124,9 +126,6 @@ if [ "${engine_requests["node"]}" == "" ]; then
echo "WARNING: No version of Node.js specified in package.json, see:" | indent
echo "https://devcenter.heroku.com/articles/nodejs-versions" | indent
echo
- echo "WARNING: The default version of Node.js and npm on Heroku will begin" | indent
- echo "tracking the latest stable release starting September 1, 2012." | indent
- echo
fi
NODE_VERSION=$(package_resolve_version "node")
View
4 bin/test
@@ -30,8 +30,8 @@ testPackageJsonWithVersion() {
testPackageJsonWithoutVersion() {
compile "package-json-noversion"
assertCaptured "WARNING: No version of Node.js specified"
- assertCaptured "Using Node.js version: 0.4.7"
- assertCaptured "Using npm version: 1.0.106"
+ assertCaptured "Using Node.js version: 0.8"
+ assertCaptured "Using npm version: 1.2"
assertCapturedSuccess
}
Please sign in to comment.
Something went wrong with that request. Please try again.