Changed the removing TFENF_VER_ARRAY

This commit is contained in:
Marcin Woźniak 2023-08-14 23:43:43 +02:00
parent d0497495f6
commit a950db00cc
Signed by: y0rune
GPG Key ID: F204C385F57EB348

View File

@ -69,7 +69,7 @@ function install_terraform() {
brew install tflint -q
brew install tfenv -q
TFENV_ARCH=amd64 tfenv install latest
TFENV_VER_ARRAY=($(tfenv list | grep -ioE ' [0-9.]+' | sed -e '1,2d'))
TFENV_VER_ARRAY=($(tfenv list | grep -ioE ' [0-9.]+' | sed -e '1,1d'))
if [ "${#TFENV_VER_ARRAY[@]}" -gt "2" ]; then
for i in "${TFENV_VER_ARRAY[@]}"; do
tfenv uninstall "$i" && timestamp "Removed - terraform '$i' version"