Search for running_vm_list only in `machines` folder
otherwise it might catch a non-machine id, in my case, for hostmanager plugin
This commit is contained in:
parent
917aab0552
commit
a2a848285c
|
@ -85,7 +85,7 @@ _vagrant() {
|
||||||
then
|
then
|
||||||
running_vm_list=$(grep 'active' "${vagrant_state_file}" | sed -e 's/"active"://' | tr ',' '\n' | cut -d '"' -f 2 | tr '\n' ' ')
|
running_vm_list=$(grep 'active' "${vagrant_state_file}" | sed -e 's/"active"://' | tr ',' '\n' | cut -d '"' -f 2 | tr '\n' ' ')
|
||||||
else
|
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
|
fi
|
||||||
COMPREPLY=($(compgen -W "${running_vm_list}" -- ${cur}))
|
COMPREPLY=($(compgen -W "${running_vm_list}" -- ${cur}))
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Reference in New Issue