Fix up prettier wrapper script

This commit is contained in:
Michael Wolf
2023-09-30 17:33:20 -06:00
parent 4c598c589e
commit 0273d5762e

View File

@@ -7,14 +7,17 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$DIR/_reformat-common.bash" source "$DIR/_reformat-common.bash"
set -e
file="$1" file="$1"
wrflog running against file "$file" pushd "$(dirname "$file")" 2>&1
if [[ "$WOULD_REFORMAT" = "would_reformat" ]]; then if [[ "$WOULD_REFORMAT" = "would_reformat" ]]; then
set +e
out=$(npx prettier --check "$file" 2>&1 >/dev/null) out=$(npx prettier --check "$file" 2>&1 >/dev/null)
retval="$?" retval="$?"
echo "$out" set -e
exit "$retval" exit "$retval"
fi fi