#!/usr/bin/env bash

check_version() {
  v="${1}"
  [ -n "$(terraform --version | grep -E "^Terraform v${v}(-dev)?$")" ]
}

cleanup() {
  rm -rf ./versions
  rm -rf ./.terraform-version
}

#!/usr/bin/env bash

check_version() {
  v="${1}"
  [ -n "$(terraform --version | grep -e "^Terraform v${v}$")" ]
}

cleanup() {
  rm -rf ./versions
  rm -rf ./.terraform-version
}

--- 
+++ 
@@ -2,7 +2,7 @@
 
 check_version() {
   v="${1}"
-  [ -n "$(terraform --version | grep -e "^Terraform v${v}$")" ]
+  [ -n "$(terraform --version | grep -E "^Terraform v${v}(-dev)?$")" ]
 }
 
 cleanup() {
Add `-dev` to the version regexp
because Terraform v0.10.0-beta2 has the postfix with `terraform --version`
