File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,22 @@ if [ "$arch" = "aarch64" ]; then
2020fi
2121
2222version=${INFRACOST_VERSION:- latest}
23+
24+ # This script only installs versions >=2.0.0; older versions are at https://github.com/infracost/infracost.
25+ if [ " $version " != " latest" ]; then
26+ major=$( echo " $version " | sed ' s/^v//' | cut -d. -f1)
27+ if ! echo " $major " | grep -qE ' ^[0-9]+$' ; then
28+ echo " Error: invalid version format: $version "
29+ exit 1
30+ fi
31+ if [ " $major " -lt 2 ]; then
32+ echo " Error: version $version is not supported by this script."
33+ echo " This script only installs versions >=2.0.0 from the infracost/cli repository."
34+ echo " For older versions, see https://github.com/infracost/infracost."
35+ exit 1
36+ fi
37+ fi
38+
2339url=" https://infracost.io/downloads/${version} "
2440tar=" infracost-$os -$arch .tar.gz"
2541echo " Downloading version ${version} of infracost-$os -$arch ..."
You can’t perform that action at this time.
0 commit comments