Skip to content

Commit

Permalink
Merge pull request #45 from rasa/patch-2
Browse files Browse the repository at this point in the history
fix: Add -d option back to shfmt command
  • Loading branch information
luizm authored May 4, 2021
2 parents 1be1f45 + 34f88bf commit 89c10e6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ if ((SHELLCHECK_DISABLE != 1)); then
$shellcheck_output
----------
You can address the above issues in on of three ways:
You can address the above issues in one of three ways:
1. Manually correct the issue in the offending shell script;
2. Disable specific issues by adding the comment:
# shellcheck disable=NNNN
Expand All @@ -155,6 +155,10 @@ fi
if ((SHFMT_DISABLE != 1)); then
printf "Validating %d shell script(s) using 'shfmt %s':\\n" "${#sh_files[@]}" "$SHFMT_OPTS"
IFS=$' \t\n' read -d '' -ra args <<<"$SHFMT_OPTS"
# Error with a diff when the formatting differs
args+=('-d')
# Disable colorization of diff output
export NO_COLOR=1
shfmt_output="$(shfmt "${args[@]}" "${sh_files[@]}" 2>&1)"
shfmt_code=$?
if ((shfmt_code == 0)); then
Expand Down Expand Up @@ -189,7 +193,7 @@ if ((CHECKBASHISMS_ENABLE == 1)); then
printf '\ncheckbashisms returned error %d finding the bashisms listed above.\n' "$checkbashisms_code"
if ((checkbashisms_code == 4)); then
# see https://github.com/duggan/shlint/blob/0fcd979319e3f37c2cd53ccea0b51e16fda710a1/lib/checkbashisms#L489
printf "\\nIgnoring 'could not find any possible bashisms in bash script' issues\\n"
printf "\\nIgnoring the spurious non-issue titled 'could not find any possible bashisms in bash script'\\n"
else
# checkbashisms returns 0-3: https://linux.die.net/man/1/checkbashisms
((exit_code |= (checkbashisms_code << 4)))
Expand Down

0 comments on commit 89c10e6

Please sign in to comment.