mirror of
https://github.com/ovh/debian-cis.git
synced 2024-11-21 21:17:00 +01:00
24 lines
365 B
Bash
Executable File
24 lines
365 B
Bash
Executable File
#!/bin/bash
|
|
# run-shellcheck
|
|
|
|
if [ ! -f tmp/shfmt ]; then
|
|
wget -O tmp/shfmt https://github.com/mvdan/sh/releases/download/v3.2.0/shfmt_v3.2.0_linux_amd64
|
|
fi
|
|
|
|
chmod +x tmp/shfmt
|
|
|
|
files=""
|
|
retval=0
|
|
|
|
if [ "$#" -eq 0 ]; then
|
|
files=$(find . -name "*.sh" | sort -V)
|
|
else
|
|
files="$*"
|
|
fi
|
|
|
|
for f in $files; do
|
|
./tmp/shfmt -l -i 4 -w "$f"
|
|
done
|
|
|
|
exit "$retval"
|