Skip to content

Commit

Permalink
Bash wrapper did not allow spaces in paths
Browse files Browse the repository at this point in the history
  • Loading branch information
nckg committed Aug 4, 2011
1 parent 0215828 commit c0460e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion env/jsc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@
alias jsc="/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc"
FILE="${1}"
OPTS="${2}"

FILE_CONTENT=$(cat "${FILE}")

if [ -L $BASH_SOURCE ]; then
ENV_HOME="$( cd "$( dirname "$(readlink "$BASH_SOURCE")" )" && pwd )"
else
ENV_HOME="$( cd "$( dirname "$BASH_SOURCE" )" && pwd )"
fi

LINT_RESULT="$(jsc ${ENV_HOME}/jsc.js -- ${FILE} "$(cat ${FILE})" "${OPTS}" ${ENV_HOME})"
LINT_RESULT=$(jsc "${ENV_HOME}"/jsc.js -- "${FILE}" "${FILE_CONTENT}" "${OPTS}" "${ENV_HOME}")
ERRORS=$(echo ${LINT_RESULT} | egrep [^\s] -c)

if [[ ${ERRORS} -ne 0 ]]; then
Expand Down

0 comments on commit c0460e9

Please sign in to comment.