Avoid exiting early when parsing git hash

See: https://github.com/Hexxeh/rpi-update/issues/245
This commit is contained in:
popcornmix
2017-06-04 17:18:30 +01:00
parent 53ac136db3
commit 551fe49161

View File

@@ -356,7 +356,7 @@ function compare_hashes {
function get_long_hash {
# ask github for long version hash
local REPO_API=${REPO_URI/github.com/api.github.com\/repos}/commits/$1
eval curl -Ls ${GITHUB_AUTH_PARAM} ${REPO_API} | awk '{ if ($1 == "\"sha\":") { print substr($2, 2, 40); exit 0 } }'
eval curl -Ls ${GITHUB_AUTH_PARAM} ${REPO_API} | awk 'BEGIN {hash=""} { if (hash == "" && $1 == "\"sha\":") {hash=substr($2, 2, 40);} } END {print hash}'
}