mirror of
https://github.com/creyD/prettier_action.git
synced 2026-04-15 12:50:31 +02:00
fix: fixes handling of bad case where there are unpretty files and command output is not 0
This commit is contained in:
@@ -51,13 +51,14 @@ fi
|
|||||||
|
|
||||||
echo "Prettifying files..."
|
echo "Prettifying files..."
|
||||||
echo "Files:"
|
echo "Files:"
|
||||||
prettier $INPUT_PRETTIER_OPTIONS || echo "Problem running prettier with $INPUT_PRETTIER_OPTIONS"
|
prettier $INPUT_PRETTIER_OPTIONS
|
||||||
PRETTIER_RESULT=$?
|
PRETTIER_RESULT=$?
|
||||||
|
|
||||||
# To keep runtime good, just continue if something was changed
|
# To keep runtime good, just continue if something was changed
|
||||||
if _git_changed; then
|
if _git_changed; then
|
||||||
if $INPUT_DRY; then
|
if $INPUT_DRY; then
|
||||||
if [[ "$PRETTIER_RESULT" -eq 1 ]]; then
|
if [[ "$PRETTIER_RESULT" -eq 1 ]]; then
|
||||||
|
echo "Problem running prettier with $INPUT_PRETTIER_OPTIONS"
|
||||||
echo "Prettier found unpretty files!"
|
echo "Prettier found unpretty files!"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user