mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-24 03:18:26 +00:00
Don't use jq to clean whitespace/quotes
It seems that older jq versions choke on some output from curl inside these scripts. But I couldn't reproduce this on the cmdline; so not really sure what's going on, suspecting some settings in the bash script. Tested this with jq-1.5 and jq-1.6, both worked. But since `xargs` also trims a string from quotes and whitespace, it can be used instead of jq in these places.
This commit is contained in:
@ -150,7 +150,7 @@ downloadAttachment() {
|
||||
DL_URL="$ATTACH_URL/$attachId"
|
||||
|
||||
checksum1=$("$CURL_CMD" -s -I -H "X-Docspell-Auth: $auth_token" "$DL_URL" | \
|
||||
grep -i 'etag' | cut -d' ' -f2 | "$JQ_CMD" -r)
|
||||
grep -i 'etag' | cut -d' ' -f2 | xargs | tr -d '\r')
|
||||
"$CURL_CMD" -s -o "$attachOut" -H "X-Docspell-Auth: $auth_token" "$DL_URL"
|
||||
checksum2=$(sha256sum "$attachOut" | cut -d' ' -f1 | xargs)
|
||||
if [ "$checksum1" == "$checksum2" ]; then
|
||||
|
Reference in New Issue
Block a user