mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
hooks: Fix dkimpy's diff check
When running a diff for dkimpy's output, we expect that diff to exit with non-zero code. Unfortunately, the way we set that expectation (by prefixing the diff invocation with `!` is incorrect. Running `! diff ...` will not cause the hook to fail if diff exits with 0, instead `!` will cause the exit code to be ignored. This patch fixes the problem by running `diff ... && exit 1` instead. This was caught by shellcheck, https://www.shellcheck.net/wiki/SC2251.
This commit is contained in:
@@ -107,9 +107,9 @@ if [ "$AUTH_AS" != "" ] && command -v dkimsign >/dev/null; then
|
||||
# dkimpy doesn't provide a way to just show the new
|
||||
# headers, so we have to compute the difference.
|
||||
# ALSOCHANGE(test/t-19-dkimpy/config/hooks/post-data)
|
||||
! diff --changed-group-format='%>' \
|
||||
diff --changed-group-format='%>' \
|
||||
--unchanged-group-format='' \
|
||||
"$TF" "$TF.dkimout"
|
||||
"$TF" "$TF.dkimout" && exit 1
|
||||
rm "$TF.dkimout"
|
||||
else
|
||||
# driusan/dkim
|
||||
|
||||
@@ -31,9 +31,9 @@ if [ "$AUTH_AS" != "" ]; then
|
||||
# dkimpy doesn't provide a way to just show the new headers, so we
|
||||
# have to compute the difference.
|
||||
# ALSOCHANGE(etc/chasquid/hooks/post-data)
|
||||
! diff --changed-group-format='%>' \
|
||||
diff --changed-group-format='%>' \
|
||||
--unchanged-group-format='' \
|
||||
"$TF" "$TF.dkimout"
|
||||
"$TF" "$TF.dkimout" && exit 1
|
||||
rm "$TF.dkimout"
|
||||
else
|
||||
# NOTE: This is using driusan/dkim instead of dkimpy, because dkimpy can't be
|
||||
|
||||
Reference in New Issue
Block a user