diff options
| author | Moritz Bunkus <mo@bunkus.online> | 2026-06-04 06:13:19 +0200 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@gmail.com> | 2026-06-04 06:14:52 +0200 |
| commit | 423bbfcafce950819f3dd5c6bdf47e700254a8f8 (patch) | |
| tree | 495cc09b5e63ba3000c745856175c147ba690aa8 /Completion/Unix | |
| parent | 44874: fix a memory leak and potential heap corruption when rotating lines (diff) | |
| download | zsh-423bbfcafce950819f3dd5c6bdf47e700254a8f8.tar zsh-423bbfcafce950819f3dd5c6bdf47e700254a8f8.tar.gz zsh-423bbfcafce950819f3dd5c6bdf47e700254a8f8.tar.bz2 zsh-423bbfcafce950819f3dd5c6bdf47e700254a8f8.tar.lz zsh-423bbfcafce950819f3dd5c6bdf47e700254a8f8.tar.xz zsh-423bbfcafce950819f3dd5c6bdf47e700254a8f8.tar.zst zsh-423bbfcafce950819f3dd5c6bdf47e700254a8f8.zip | |
49676: _ansible: re-read cached hosts & groups on directory change
Diffstat (limited to 'Completion/Unix')
| -rw-r--r-- | Completion/Unix/Command/_ansible | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_ansible b/Completion/Unix/Command/_ansible index 554e61c49..b66f21523 100644 --- a/Completion/Unix/Command/_ansible +++ b/Completion/Unix/Command/_ansible @@ -208,10 +208,15 @@ case $state in else local -a inventory typeset -ga _ansible_hosts _ansible_groups + typeset -g _ansible_inventory_last_cwd + if [[ $PWD != $_ansible_inventory_last_cwd ]]; then + unset _ansible_hosts _ansible_groups + fi if (( !$#_ansible_hosts || !$#_ansible_groups )); then inventory=( ${(f)"$(_call_program groups ansible-inventory --graph)"} ) _ansible_hosts=( ${${(M)inventory%--[^:]#}#--} ) _ansible_groups=( ${${${(M)inventory%@*:}%:}#@} ) + _ansible_inventory_last_cwd=$PWD fi if [[ $state = hosts ]]; then suf=( -qS: ) |
