brew install warrensbox/tap/tfswitch
tfswitch
Select the version of terraform
that you want to install.
Use tfswitch
for different versions of terraform
when cd'ing into a project directory.
cd ~/Projects/terraform/azure
echo "0.12.19" >> .tfswitchrc
Add the following to your zsh
configuration
load-tfswitch() {
local tfswitchrc_path=".tfswitchrc"
if [ -f "$tfswitchrc_path" ]; then
tfswitch
fi
}
add-zsh-hook chpwd load-tfswitch
load-tfswitch