mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
b9d13467b9
We need to run on a directory since shell files might have no extension. There are few shell files, so speed should not be an issue. Fixes #1166.
22 lines
430 B
Bash
Executable File
22 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
|