Skip to content

Commit

Permalink
add a warning of no version of node.js specified in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
ddollar committed Mar 27, 2012
1 parent 85170d5 commit c09c3f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions bin/test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c09c3f8

Please sign in to comment.