Ok, it seems I found a solution, but its not very pretty:
IMG = "MACHINE"
if File.exists?('.vagrant/machines/host/virtualbox/index_uuid')
BOX_UID = File.read(".vagrant/machines/host/virtualbox/index_uuid")
BOX_VER = `grep -oP "(?<=#{BOX_UID}).+(?=}}}}})"
~/.vagrant.d/data/machine-index/index | grep -oP '(?<=version":").+(?=")'`
else
BOX_VER = `vagrant box list | grep #{IMG} | cut -d ',' -f 2 | grep -oP
'(?<=\\ ).+?(?=\\))'`
end
# Print some informations about the machine,
# if provisioning isn't done
if not File.exists?('.vagrant/machines/host/virtualbox/action_provision')
puts " --- MACHINE CONFIGURATION ---"
puts " BOX VERSION:\t%s" %[BOX_VER]
puts " -----------------------------"
end
And that all, because I don't know how to access the object #version in
Vagrant::Box::Class *grml*
--
You received this message because you are subscribed to the Google Groups
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.