Commit 17ec8908 authored by Craig Barrett's avatar Craig Barrett

Terraform version filenames should use a dash not underscore

parent d9194460
#!/bin/bash
installed_version=$(terraform -version | cut -d v -f 2 | head -1)
env_tf_version_file="${dir:-.}/../environments/${environment:-.}/.terraform_version"
repo_tf_version_file="${dir:-.}/../.terraform_version"
if [[ ! -r "$repo_tf_version_file" ]]; then
echo -e "${_BRED}Repository is missing $repo_tf_version_file ${_NORM}"
exit 1
fi
env_tf_version_file="${dir:-.}/../environments/${environment:-.}/.terraform-version"
repo_tf_version_file="${dir:-.}/../.terraform-version"
if [[ -n $TF_VERSION ]]; then
required_version="$TF_VERSION"
elif [[ -r "$env_tf_version_file" ]]; then
required_version=$(cat "$env_tf_version_file")
else
elif [[ -r "$repo_tf_version_file" ]]; then
required_version=$(cat "$repo_tf_version_file")
else
echo -e "${_BRED}ERROR: ${_NORM}No suitable .terraform-version file found; exiting."
exit 1
fi
if [[ "$installed_version" != "$required_version" ]]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment