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>
This commit is contained in:
parent
2d8d60b005
commit
13470c0df3
@ -86,7 +86,7 @@ checkLatestVersion() {
|
|||||||
if type "curl" > /dev/null; then
|
if type "curl" > /dev/null; then
|
||||||
TAG=$(curl -Ls -o /dev/null -w %{url_effective} $latest_release_url | grep -oE "[^/]+$" )
|
TAG=$(curl -Ls -o /dev/null -w %{url_effective} $latest_release_url | grep -oE "[^/]+$" )
|
||||||
elif type "wget" > /dev/null; then
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user