Fix up prettier wrapper script
This commit is contained in:
11
prettier.sh
11
prettier.sh
@@ -7,18 +7,21 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
source "$DIR/_reformat-common.bash"
|
||||
|
||||
set -e
|
||||
|
||||
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)
|
||||
retval="$?"
|
||||
echo "$out"
|
||||
set -e
|
||||
exit "$retval"
|
||||
fi
|
||||
|
||||
if [[ "$WOULD_REFORMAT" = "do_reformat" ]] ; then
|
||||
if [[ "$WOULD_REFORMAT" = "do_reformat" ]]; then
|
||||
out=$(npx prettier --write "$file" 2>&1 >/dev/null)
|
||||
retval="$?"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user