Skip to content

Commit

Permalink
Suppress the 'zsh: no matches found:' message.
Browse files Browse the repository at this point in the history
  • Loading branch information
mazgi committed Sep 24, 2022
1 parent 20e57af commit dcadd66
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/provisioning.init-terraform-with-backend.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ exitBecauseOfInsufficientCredentials() {
}

disableUnnecessaryBackendConfigs() {
for unnecessary_tf in $(ls -1 backend.*.tf~*${TFSTATE_BACKEND_TYPE}*)
# Suppress the 'zsh: no matches found:' message.
# See
# - https://zsh.sourceforge.io/Doc/Release/Options.html#Expansion-and-Globbing
# - https://zsh.sourceforge.io/Doc/Release/Options.html#index-LOCALOPTIONS
unsetopt local_options nomatch
for unnecessary_tf in $(ls -1 backend.*.tf~*${TFSTATE_BACKEND_TYPE}* 2> /dev/null || true)
do
echoWarn "WARN: The backend config ${unnecessary_tf} will be renamed to disable."
echoWarn "$(mv --verbose ${unnecessary_tf}{,.disabled.txt})"
Expand Down

0 comments on commit dcadd66

Please sign in to comment.