c258a2d8f0
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
21 lines
430 B
Bash
Executable file
21 lines
430 B
Bash
Executable file
#!/bin/bash
|
|
|
|
badFiles=()
|
|
while read f; do
|
|
badFiles+=("$f")
|
|
done < <(shfmt -l . | grep -v Godeps/)
|
|
|
|
if [ ${#badFiles[@]} -eq 0 ]; then
|
|
echo 'Congratulations! All shell source files are properly formatted.'
|
|
else
|
|
{
|
|
echo "These files are not properly shfmt'd:"
|
|
for f in "${badFiles[@]}"; do
|
|
echo " - $f"
|
|
done
|
|
echo
|
|
echo 'Please reformat the above files using "shfmt -w" and commit the result.'
|
|
echo
|
|
} >&2
|
|
false
|
|
fi
|