Skip to content
Browse files

add a warning of no version of node.js specified in package.json

  • Loading branch information...
1 parent 85170d5 commit c09c3f8380665c2dbe82d820f1ddd0dd5a04a46c @ddollar ddollar committed Mar 27, 2012
Showing with 11 additions and 0 deletions.
  1. +9 −0 bin/compile
  2. +2 −0 bin/test
View
9 bin/compile
@@ -116,6 +116,15 @@ engine_versions["npm"]=$(manifest_versions "npm")
engine_requests["npm"]=$(package_engine_version "npm")
echo "-----> Resolving engine versions"
+
+# add a warning if no version of node specified
+if [ "${engine_requests["node"]}" == "" ]; then
+ echo
+ echo "WARNING: No version of Node.js specified in package.json, see:" | indent
+ echo "https://devcenter.heroku.com/articles/nodejs-versions" | indent
+ echo
+fi
+
NODE_VERSION=$(package_resolve_version "node")
echo "Using Node.js version: ${NODE_VERSION}" | indent
View
2 bin/test
@@ -21,13 +21,15 @@ testDetectWithoutPackageJson() {
testPackageJsonWithVersion() {
compile "package-json-version"
+ assertNotCaptured "WARNING: No version of Node.js specified"
assertCaptured "Using Node.js version: 0.6.11"
assertCaptured "Using npm version: 1.1.9"
assertCapturedSuccess
}
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"
assertCapturedSuccess

0 comments on commit c09c3f8

Please sign in to comment.
Something went wrong with that request. Please try again.