Skip to content

Commit 89c10e6

Browse files
authored
Merge pull request #45 from rasa/patch-2
fix: Add -d option back to shfmt command
2 parents 1be1f45 + 34f88bf commit 89c10e6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

entrypoint.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ if ((SHELLCHECK_DISABLE != 1)); then
139139
$shellcheck_output
140140
----------
141141
142-
You can address the above issues in on of three ways:
142+
You can address the above issues in one of three ways:
143143
1. Manually correct the issue in the offending shell script;
144144
2. Disable specific issues by adding the comment:
145145
# shellcheck disable=NNNN
@@ -155,6 +155,10 @@ fi
155155
if ((SHFMT_DISABLE != 1)); then
156156
printf "Validating %d shell script(s) using 'shfmt %s':\\n" "${#sh_files[@]}" "$SHFMT_OPTS"
157157
IFS=$' \t\n' read -d '' -ra args <<<"$SHFMT_OPTS"
158+
# Error with a diff when the formatting differs
159+
args+=('-d')
160+
# Disable colorization of diff output
161+
export NO_COLOR=1
158162
shfmt_output="$(shfmt "${args[@]}" "${sh_files[@]}" 2>&1)"
159163
shfmt_code=$?
160164
if ((shfmt_code == 0)); then
@@ -189,7 +193,7 @@ if ((CHECKBASHISMS_ENABLE == 1)); then
189193
printf '\ncheckbashisms returned error %d finding the bashisms listed above.\n' "$checkbashisms_code"
190194
if ((checkbashisms_code == 4)); then
191195
# see https://github.com/duggan/shlint/blob/0fcd979319e3f37c2cd53ccea0b51e16fda710a1/lib/checkbashisms#L489
192-
printf "\\nIgnoring 'could not find any possible bashisms in bash script' issues\\n"
196+
printf "\\nIgnoring the spurious non-issue titled 'could not find any possible bashisms in bash script'\\n"
193197
else
194198
# checkbashisms returns 0-3: https://linux.die.net/man/1/checkbashisms
195199
((exit_code |= (checkbashisms_code << 4)))

0 commit comments

Comments
 (0)