Skip to content

Commit

Permalink
Merge pull request #104783 from YuviGold/fix-shellcheck-output-streams
Browse files Browse the repository at this point in the history
Fix shellcheck output streams
  • Loading branch information
k8s-ci-robot committed Oct 14, 2021
2 parents 30a32a3 + bcb5d29 commit c2bff66
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hack/verify-shellcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,18 @@ SHELLCHECK_OPTIONS=(
)

# tell the user which we've selected and lint all scripts
# The shellcheck errors are printed to stdout by default, hence they need to be redirected
# to stderr in order to be well parsed for Junit representation by juLog function
res=0
if ${HAVE_SHELLCHECK}; then
echo "Using host shellcheck ${SHELLCHECK_VERSION} binary."
shellcheck "${SHELLCHECK_OPTIONS[@]}" "${all_shell_scripts[@]}" || res=$?
shellcheck "${SHELLCHECK_OPTIONS[@]}" "${all_shell_scripts[@]}" >&2 || res=$?
else
echo "Using shellcheck ${SHELLCHECK_VERSION} docker image."
"${DOCKER}" run \
--rm -v "${KUBE_ROOT}:${KUBE_ROOT}" -w "${KUBE_ROOT}" \
"${SHELLCHECK_IMAGE}" \
shellcheck "${SHELLCHECK_OPTIONS[@]}" "${all_shell_scripts[@]}" || res=$?
shellcheck "${SHELLCHECK_OPTIONS[@]}" "${all_shell_scripts[@]}" >&2 || res=$?
fi

# print a message based on the result
Expand Down

0 comments on commit c2bff66

Please sign in to comment.