diff --git a/libexec/tfenv-list-remote b/libexec/tfenv-list-remote index ff99959..4590049 100755 --- a/libexec/tfenv-list-remote +++ b/libexec/tfenv-list-remote @@ -66,8 +66,11 @@ fi TFENV_REMOTE="${TFENV_REMOTE:-https://releases.hashicorp.com}" log 'debug' "TFENV_REMOTE: ${TFENV_REMOTE}"; -declare remote_versions="$(curlw -sf "${TFENV_REMOTE}/terraform/")"; + +declare remote_versions; +remote_versions="$(curlw -sSf "${TFENV_REMOTE}/terraform/")" \ + || log 'error' "Failed to download remote versions from ${TFENV_REMOTE}/terraform/"; + #log 'debug' "Remote versions available: ${remote_versions}"; # Even in debug mode this is too verbose -curlw -sf "${TFENV_REMOTE}/terraform/" \ - | grep -o -E "[0-9]+\.[0-9]+\.[0-9]+(-(rc|beta|alpha|oci)[0-9]*)?" \ - | uniq; + +grep -o -E "[0-9]+\.[0-9]+\.[0-9]+(-(rc|beta|alpha|oci)[0-9]*)?" <<<"${remote_versions}" | uniq;