From a2a848285cc2481398093a4b4528047be4264dd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Waldemar=20=C5=BBurowski?= <45210402+wzur-r3@users.noreply.github.com> Date: Thu, 9 May 2019 18:07:23 +0100 Subject: [PATCH] Search for running_vm_list only in `machines` folder otherwise it might catch a non-machine id, in my case, for hostmanager plugin --- contrib/bash/completion.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/bash/completion.sh b/contrib/bash/completion.sh index a3963a7c7..770e13ee0 100644 --- a/contrib/bash/completion.sh +++ b/contrib/bash/completion.sh @@ -85,7 +85,7 @@ _vagrant() { then running_vm_list=$(grep 'active' "${vagrant_state_file}" | sed -e 's/"active"://' | tr ',' '\n' | cut -d '"' -f 2 | tr '\n' ' ') else - running_vm_list=$(find "${vagrant_state_file}" -type f -name "id" | awk -F"/" '{print $(NF-2)}') + running_vm_list=$(find "${vagrant_state_file}/machines" -type f -name "id" | awk -F"/" '{print $(NF-2)}') fi COMPREPLY=($(compgen -W "${running_vm_list}" -- ${cur})) return 0