From 5f9d2f7679edaf42bb7dad12f829ded89f780cfa Mon Sep 17 00:00:00 2001 From: Michael Wolf Date: Wed, 20 Sep 2023 10:10:04 -0600 Subject: [PATCH] Make shellcheck happier --- prettier.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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