Fix some vagrant segment copypasta

This commit is contained in:
Justin Hileman 2016-02-19 10:06:52 -08:00
parent 29d78ebaf3
commit 47eace4182

View File

@ -189,23 +189,21 @@ end
# ===========================
function __bobthefish_prompt_vagrant -S -d 'Display Vagrant status'
[ "$theme_display_vagrant" != 'yes' ]; and return
if [ -f Vagrantfile ]
[ "$theme_display_vagrant" = 'yes' -a -f Vagrantfile ]; or return
if type -q VBoxManage
__bobthefish_prompt_vagrant_vbox
else if grep vmware_fusion Vagrantfile >/dev/null ^&1
__bobthefish_prompt_vagrant_vmware
end
end
end
function __bobthefish_vagrant_vmware_ids -S -d 'List Vagrant machine ids'
function __bobthefish_vagrant_ids -S -d 'List Vagrant machine ids'
cat .vagrant/machines/**/id
end
function __bobthefish_prompt_vagrant_vbox -S -d 'Display VirtualBox Vagrant status'
set -l vagrant_status
for id in __bobthefish_vagrant_ids
for id in (__bobthefish_vagrant_ids)
set -l vm_status (VBoxManage showvminfo --machinereadable $id ^/dev/null | grep 'VMState=' | tr -d '"' | cut -d '=' -f 2)
switch "$vm_status"
case 'running'