Fix resolve_version_query to not kill tee in filter_version_candidates (#264)

Prior to this change the awk 'prog' contained an exit command. When tee attempted to write to the stdout at this point, it received a SIGPIPE signal and exited with an error code of 141. I can't seem to find a way to have tee ignore this signal, but I don't believe the overhead of awk doing a small comparison will have a large/any performance impact especially relative to the processing in filter_version_candidates

Fixes #263
This commit is contained in:
Michael Poutre 2021-10-07 05:15:13 -07:00 committed by GitHub
parent c873ec9d13
commit a32e6c9751
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,7 +94,8 @@ resolve_version_query() {
local canon_version="$(
# Find the first candidate which the alias match, then print it version
print_index_tab \
| awk -F'\t' -v "alias=$version_query" '$1 == alias { print $2; exit }'
| awk -F'\t' -v "alias=$version_query" '$1 == alias { print $2 }' \
| head -n 1
)"
if [ -z "$canon_version" ]; then