From f381d8120684ace979b84e8697bc9a37cdbe690e Mon Sep 17 00:00:00 2001 From: Spencer Owen Date: Sun, 6 Nov 2016 17:08:13 -0700 Subject: [PATCH] Throw error if azure-setup.sh using incompatible cli. --- contrib/azure-setup.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/contrib/azure-setup.sh b/contrib/azure-setup.sh index 37c618e45..c8efc35bb 100755 --- a/contrib/azure-setup.sh +++ b/contrib/azure-setup.sh @@ -65,6 +65,27 @@ requirements() { echo "https://stedolan.github.io/jq/" fi + # azure-cli 0.10.5 includes a breaking change + # warn if using an incompatible azure-cli version + # This is just a work around until a more appropriate fix is available + supported_version=true + IFS='.' read -ra azureversionsemver <<< "$azureversion" + if [ ${azureversionsemver[0]} -gt 0 ]; then + supported_version=false + fi + if [ ${azureversionsemver[1]} -gt 10 ]; then + supported_version=false + fi + if [ ${azureversionsemver[2]} -gt 4 ]; then + supported_version=false + fi + + echo "supported_version is $supported_version" + if [ "${supported_version}" = false ]; then + echo "Error: azure-cli must be 0.10.4 or older, see http://bit.ly/2etirbM" + exit 1 + fi + if [ $found -lt 2 ]; then exit 1 fi