From: Robert Konigsberg Date: Sun, 17 Feb 2013 12:57:33 +0000 (-0500) Subject: Return failure code when lint fails. X-Git-Tag: v1.0.0~51^2~1 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=d3b494307a47a61c2b0495ff36dcead00812213e;p=dygraphs.git Return failure code when lint fails. --- diff --git a/lint.sh b/lint.sh index d349e7c..ef4dacd 100755 --- a/lint.sh +++ b/lint.sh @@ -18,6 +18,8 @@ if [ $# -gt 1 ]; then exit 1 fi +RETURN_VALUE=0 + if [ $# -eq 0 ]; then files=$(ls dygraph*.js plugins/*.js | grep -v combined | grep -v dev.js| grep -v externs) else @@ -28,7 +30,7 @@ if [ -e /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources # use JSC (Safari/JavaScriptCore) to run JSHint -- much faster than Rhino. echo 'Running JSHint w/ JavaScriptCore (jsc)...' for file in $files; do - ./jshint/env/jsc.sh $file $jsc_opts + ./jshint/env/jsc.sh $file $jsc_opts || RETURN_VALUE=1 done else # fall back to Rhino. @@ -40,8 +42,11 @@ else if [[ ${ERRORS} -ne 0 ]]; then echo "[jshint] Error(s) in ${FILE}:" printf "%s\n" "${LINT_RESULT}" + RETURN_VALUE=1 else echo "[jshint] ${FILE} passed!" fi done fi + +exit $RETURN_VALUE