shellcheck-scripts
1#!/usr/bin/env bash
2
3set -euo pipefail
4
5mode=${1:-error}
6[[ "$mode" =~ ^(error|warning)$ ]] || { echo "Usage: $0 [error|warning]"; exit 1; }
7
8cd "$(dirname "$0")/.." || exit 1
9
10find script -maxdepth 1 -type f -print0 |
11 xargs -0 grep -l -E '^#!(/bin/|/usr/bin/env )(sh|bash|dash)' |
12 xargs -r shellcheck -x -S "$mode" -C