Skip to content

Commit

Permalink
Merge pull request #387 from hexfusion/add-shellcheck
Browse files Browse the repository at this point in the history
hack: add shellcheck
  • Loading branch information
openshift-merge-robot committed Jul 9, 2020
2 parents 8476f73 + 856d090 commit 08b912a
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 08b912a

Please sign in to comment.