Code check / Check code (push) Failing after 31s
Signed-off-by: Boris Yumankulov <boria138@altlinux.org>
25 lines
442 B
Bash
Executable File
25 lines
442 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cr=$(printf "\r")
|
|
status=0
|
|
|
|
for file in "$@"; do
|
|
IFS= read -r first_line < "$file" || true
|
|
|
|
case "$first_line" in
|
|
"#!"*"$cr")
|
|
echo "$file: trailing <CR> in interpreter: $first_line"
|
|
status=1
|
|
continue
|
|
;;
|
|
esac
|
|
|
|
if ! bash -n "$file"; then
|
|
echo "$file: bash -n syntax check failed"
|
|
status=1
|
|
fi
|
|
done
|
|
|
|
exit "$status"
|