tFix return status during use of compact conditionals - scholarref - tools for … | |
git clone git://src.adamsgaard.dk/scholarref | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 4d98fd2155f080ea08ee13a25de2fcd21a16f7d6 | |
parent 9d653a034f6d3ca1fde34d264f10f3af23922aff | |
Author: Anders Damsgaard <[email protected]> | |
Date: Fri, 15 Nov 2019 14:51:20 +0100 | |
Fix return status during use of compact conditionals | |
Diffstat: | |
M getref | 9 ++++----- | |
1 file changed, 4 insertions(+), 5 deletions(-) | |
--- | |
diff --git a/getref b/getref | |
t@@ -100,22 +100,21 @@ strip_doi() { | |
get_citation() { | |
doi=$(echo "$1" | strip_doi) | |
url="$host/$1" | |
- [ "$verbose" = 1 ] && echo "connecting to $url" | |
+ [ "$verbose" = 1 ] && echo "connecting to $url" || : | |
result=$($prefix curl --location \ | |
--header "Accept: application/x-bibtex" \ | |
--silent --show-error "$url") | |
echo "$result" | grep -q '<html>' && die 'no result found' | |
result="$(echo "$result" | format_bibtex_key)" | |
- [ "$fulljournal" = 0 ] && result="$(echo "$result" | abbreviate_journa… | |
- [ "$fullauthor" = 0 ] && result="$(echo "$result" | abbreviate_author_… | |
+ [ "$fulljournal" = 0 ] && result="$(echo "$result" | abbreviate_journa… | |
+ [ "$fullauthor" = 0 ] && result="$(echo "$result" | abbreviate_author_… | |
result="$(echo "$result" | grep -v -e 'url = ' -e 'month = ' )" | |
if [ "$nonewline" = 1 ]; then | |
printf "\n%s" "$result" | |
else | |
echo "$result" | |
fi | |
- [ "$notify" = 1 ] && notify-send "${0##*/}" "added: $(echo "$result" |… | |
- printf '' | |
+ [ "$notify" = 1 ] && notify-send "${0##*/}" "added: $(echo "$result" |… | |
} | |
verbose=0 |