Simplify lowercase grep logic in docker script

See gh-24811
2.2.x
Madhura Bhave 4 years ago
parent aefeb3ffaf
commit a78ec9da6a

@ -1,6 +1,6 @@
#!/bin/bash
latest_version=$(curl -I -s https://github.com/docker/docker-ce/releases/latest | awk '{print tolower($0)}' | grep "location:" | awk '{n=split($0, parts, "/"); print substr(parts[n],2);}' | awk '{$1=$1;print}' | tr -d '\r' | tr -d '\n' )
latest_version=$(curl -I -s https://github.com/docker/docker-ce/releases/latest | grep -i "location:" | awk '{n=split($0, parts, "/"); print substr(parts[n],2);}' | awk '{$1=$1;print}' | tr -d '\r' | tr -d '\n' )
if [[ $latest_version =~ (beta|rc) ]]; then
echo "Skip pre-release versions"

Loading…
Cancel
Save