fix: limit dclint scanning to immediate stack directories
This commit is contained in:
1 parent
abf61c979f
commit
1c12f71a87
1 file changed
+13
-1
@@ -4,12 +4,24 @@ set -euo pipefail
|
||||
SCRIPT_DIR="$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")"
|
||||
STACKS_DIR="${STACKS_DIR:-$SCRIPT_DIR}"
|
||||
docker_args=(--rm -v "$STACKS_DIR:/app")
|
||||
dclint_args=(. -r)
|
||||
dclint_args=()
|
||||
|
||||
if [[ -t 1 ]]; then
|
||||
docker_args+=(-t)
|
||||
fi
|
||||
|
||||
# Scan immediate stack directories without recursing into their subdirectories.
|
||||
shopt -s nullglob
|
||||
for stack_dir in "$STACKS_DIR"/*/; do
|
||||
stack_dir="${stack_dir%/}"
|
||||
dclint_args+=("/app/${stack_dir##*/}")
|
||||
done
|
||||
|
||||
if ((${#dclint_args[@]} == 0)); then
|
||||
printf 'No stack directories found in %s\n' "$STACKS_DIR" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "${1:-}" in
|
||||
"")
|
||||
;;
|
||||
|
||||
Reference in new issue
Block a user