1
0
mirror of https://github.com/openshift/installer.git synced 2026-02-05 06:46:36 +01:00
Files
installer/hack/shellcheck.sh
Vince Prignano d33bede015 hack/shellcheck: update for cluster-api folder
Signed-off-by: Vince Prignano <vincepri@redhat.com>
2023-10-23 11:29:31 -07:00

18 lines
529 B
Bash
Executable File

#!/bin/sh
if [ "$IS_CONTAINER" != "" ]; then
TOP_DIR="${1:-.}"
find "${TOP_DIR}" \
-path "${TOP_DIR}/vendor" -prune \
-o -path "${TOP_DIR}/cluster-api/*/vendor" -prune \
-o -path "${TOP_DIR}/terraform/*/vendor" -prune \
-o -type f -name '*.sh' -exec shellcheck --format=gcc {} \+
else
podman run --rm \
--env IS_CONTAINER=TRUE \
--volume "${PWD}:/workdir:ro,z" \
--entrypoint sh \
--workdir /workdir \
quay.io/coreos/shellcheck-alpine:v0.5.0 \
/workdir/hack/shellcheck.sh "${@}"
fi;