Skip to content
This repository has been archived by the owner on Jan 20, 2020. It is now read-only.

Commit

Permalink
[GH-1]: Dealing with filename spaces correctly
Browse files Browse the repository at this point in the history
Should fix #1.  Thanks to hearsaydiv for finding
and fixing the bug.
  • Loading branch information
hearsaydev authored and mikewest committed Feb 6, 2011
1 parent 91ee7df commit c427830
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions scripts/jslint-to-xml.sh
Expand Up @@ -65,8 +65,8 @@ else
# Process `LINTEE` to extract the file extension and basename. We'll
# use both to generate the test name that's displayed in Hudson.
#
LINTEE_TYPE=`echo ${LINTEE} | sed 's#\(.*\)\.\([^\.]*\)$#\2#'`
LINTEE_BASENAME=`basename ${LINTEE} | sed 's#\(.*\)\.\([^\.]*\)$#\1#'`
LINTEE_TYPE=`echo "${LINTEE}" | sed 's#\(.*\)\.\([^\.]*\)$#\2#'`
LINTEE_BASENAME=`basename "${LINTEE}" | sed 's#\(.*\)\.\([^\.]*\)$#\1#'`

#
# Using the extension and basename, generate a test name in the form:
Expand All @@ -93,7 +93,7 @@ else
#
# What a mess.
#
LINT_TIME=`( time ${JSLINT} "${LINTEE}" 2>&1 1> "${TEMP}"; ) 2>&1 | grep real | sed 's#.*m\(.*\)s#\1#'`
LINT_TIME=`( time "${JSLINT}" "${LINTEE}" 2>&1 1> "${TEMP}"; ) 2>&1 | grep real | sed 's#.*m\(.*\)s#\1#'`
#
# After all that, read the tempfile back into `LINT_RESULTS`.
#
Expand All @@ -108,7 +108,7 @@ else
#
# And now we're completely finished with the temp file. Kill it.
#
rm ${TEMP}
rm "${TEMP}"

#
# If the test failed, write out a testsuite XML block into the
Expand Down
8 changes: 4 additions & 4 deletions scripts/run-jslint.sh
Expand Up @@ -47,7 +47,7 @@ if [ ! -e "$1" ]; then
#
else
LINTEE=$1
LINTEE_TYPE=`echo ${LINTEE} | sed 's#\(.*\)\.\([^\.]*\)$#\2#'`
LINTEE_TYPE=`echo "${LINTEE}" | sed 's#\(.*\)\.\([^\.]*\)$#\2#'`

#
# For CSS files, prepend `@charset "UTF-8";`, write to a temp file
Expand All @@ -60,7 +60,7 @@ else
echo "FATAL: Couldn't create temp file for reports"
exit 1
}
awk -v PREPEND='@charset "UTF-8";' 'BEGIN {print PREPEND}{print}' ${LINTEE} > ${TOPARSE}
awk -v PREPEND='@charset "UTF-8";' 'BEGIN {print PREPEND}{print}' "${LINTEE}" > "${TOPARSE}"
TODISPLAY=$LINTEE
#
# For everything else (that is, JavaScript, because what else is
Expand All @@ -77,12 +77,12 @@ else
# fast. Much, much, much faster than Rhino.
#
if [ -n "`which node`" ]; then
node ${NODE_JSLINT} "${TOPARSE}" "${TODISPLAY}"
node "${NODE_JSLINT}" "${TOPARSE}" "${TODISPLAY}"
#
# Fallback to Rhino if we have to. Even though it's ugly and
# slow and makes babies cry.
#
else
java -jar ${RHINO} ${RHINO_JSLINT} "${TOPARSE}" "${TODISPLAY}"
java -jar "${RHINO}" "${RHINO_JSLINT}" "${TOPARSE}" "${TODISPLAY}"
fi
fi

0 comments on commit c427830

Please sign in to comment.