Skip to content

Commit

Permalink
hack: add shellcheck
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
  • Loading branch information
hexfusion committed Jul 8, 2020
1 parent e2b9445 commit 856d090
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions hack/shellcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
set -eux

#TODO add make support in https://github.com/openshift/build-machinery-go

if [ "${IS_CONTAINER:-}" != "" ]; then
TOP_DIR="${1:-.}"
find "${TOP_DIR}" \
-path "${TOP_DIR}/vendor" -prune \
-o -type f -name '*.sh' -exec shellcheck --format=gcc {} \+
else
docker run --rm \
--env IS_CONTAINER=TRUE \
--volume "${PWD}:/workdir:ro,z" \
--entrypoint sh \
--workdir /workdir \
koalaman/shellcheck-alpine:stable \
/workdir/hack/shellcheck.sh "${@}"
fi;

0 comments on commit 856d090

Please sign in to comment.