diff --git a/CHANGELOG.md b/CHANGELOG.md index ce7bea66..4160fbe1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - Add a new `bun` item ([#485][] - @will-stone) +### Bug fixes + +- Check that `terraform` binary exists before trying to use it ([#534][] - @jcollado) + ## [v6.1.1][] (Dec 27 2023) ### Bug fixes diff --git a/functions/_tide_item_terraform.fish b/functions/_tide_item_terraform.fish index c079ce3b..01e07a83 100644 --- a/functions/_tide_item_terraform.fish +++ b/functions/_tide_item_terraform.fish @@ -1,5 +1,6 @@ function _tide_item_terraform path is $_tide_parent_dirs/.terraform && + which terraform >/dev/null && terraform workspace show | string match -v default | read -l w && _tide_print_item terraform $tide_terraform_icon' ' $w end diff --git a/tests/_tide_item_terraform.test.fish b/tests/_tide_item_terraform.test.fish index f889b006..4a13650d 100644 --- a/tests/_tide_item_terraform.test.fish +++ b/tests/_tide_item_terraform.test.fish @@ -10,6 +10,7 @@ set -lx tide_terraform_icon 󱁢 set -l terraformDir (mktemp -d) cd $terraformDir +mock which terraform "echo /usr/local/bin/terraform" mock terraform "workspace show" "echo default" _terraform # CHECK: