diff --git a/prettier.sh b/prettier.sh index 594abbe..650226a 100755 --- a/prettier.sh +++ b/prettier.sh @@ -9,17 +9,20 @@ source "$DIR/_reformat-common.bash" file="$1" -wrflog running against file $file +wrflog running against file "$file" -if [[ x"$WOULD_REFORMAT" = x"would_reformat" ]] ; then - out=$(npx prettier --check $file 2>&1 >/dev/null) +if [[ "$WOULD_REFORMAT" = "would_reformat" ]] ; then + out=$(npx prettier --check "$file" 2>&1 >/dev/null) retval="$?" + echo "$out" exit "$retval" fi -if [[ x"$WOULD_REFORMAT" = x"do_reformat" ]] ; then # - out=$(npx prettier --write $file 2>&1 >/dev/null) +if [[ "$WOULD_REFORMAT" = "do_reformat" ]] ; then + out=$(npx prettier --write "$file" 2>&1 >/dev/null) retval="$?" + + echo "$out" exit "$retval" fi