Fix install.sh script if curl is not present (#414)

At least with bash 5.0.18, GNU Wget 1.20.3 and GNU Awk 5.1.0 the wget installation methods fails because the awk regex does not match the location header. In these versions, instead of `/^  Location:...` it must be `/^Location:...`. In order to retain compatibility with other versions having a different behavior, I changed it to `/^\s*Location:...`.

Signed-off-by: Bastian Hofmann <bashofmann@gmail.com>
pull/415/head
Bastian Hofmann 4 years ago committed by GitHub
parent 2d8d60b005
commit 13470c0df3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      install.sh

@ -86,7 +86,7 @@ checkLatestVersion() {
if type "curl" > /dev/null; then
TAG=$(curl -Ls -o /dev/null -w %{url_effective} $latest_release_url | grep -oE "[^/]+$" )
elif type "wget" > /dev/null; then
TAG=$(wget $latest_release_url --server-response -O /dev/null 2>&1 | awk '/^ Location: /{DEST=$2} END{ print DEST}' | grep -oE "[^/]+$")
TAG=$(wget $latest_release_url --server-response -O /dev/null 2>&1 | awk '/^\s*Location: /{DEST=$2} END{ print DEST}' | grep -oE "[^/]+$")
fi
}

Loading…
Cancel
Save