Skip to content

Commit c1b10dc

Browse files
committed
Hotfix jq format
Only output error messages if the diff of the file with the reformated file has changes.
1 parent 22cd4a5 commit c1b10dc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

scripts/jq_format.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ for FILE in $FILES; do
66
then
77
if ! diff --unified "$FILE" "$FILE.temp" > "$FILE.diff"; then
88
EXIT_CODE=1
9-
fi
10-
if [ "$1" == "--diff" ]; then
11-
cat "$FILE.diff"
12-
elif [ "$1" == "--apply" ]; then
13-
cp "$FILE.temp" "$FILE"
14-
else
15-
printf "%s;; \`jq\` would format this file. Use \`./scripts/jq_format.sh --diff\` to see the changes it would make and \`./scripts/jq_format.sh --apply\` to aply them.\n" "$FILE"
9+
if [ "$1" == "--diff" ]; then
10+
cat "$FILE.diff"
11+
elif [ "$1" == "--apply" ]; then
12+
cp "$FILE.temp" "$FILE"
13+
else
14+
printf "%s;; \`jq\` would format this file. Use \`./scripts/jq_format.sh --diff\` to see the changes it would make and \`./scripts/jq_format.sh --apply\` to aply them.\n" "$FILE"
15+
fi
1616
fi
1717
rm "$FILE.diff"
1818
fi

0 commit comments

Comments
 (0)