fix: fixes handling of bad case where there are unpretty files and command output is not 0

This commit is contained in:
Fabricio Sander
2021-03-25 20:50:30 -03:00
parent 217be60a6a
commit 70f47fbe7e

View File

@@ -51,13 +51,14 @@ fi
echo "Prettifying files..."
echo "Files:"
prettier $INPUT_PRETTIER_OPTIONS || echo "Problem running prettier with $INPUT_PRETTIER_OPTIONS"
prettier $INPUT_PRETTIER_OPTIONS
PRETTIER_RESULT=$?
# To keep runtime good, just continue if something was changed
if _git_changed; then
if $INPUT_DRY; then
if [[ "$PRETTIER_RESULT" -eq 1 ]]; then
echo "Problem running prettier with $INPUT_PRETTIER_OPTIONS"
echo "Prettier found unpretty files!"
exit 1
else