Handle MacPorts strange VirtualBox version formatting [GH-619]

This commit is contained in:
Mitchell Hashimoto 2012-01-04 21:46:46 -08:00
parent fc3bb6ca92
commit 323663c4fb
1 changed files with 8 additions and 1 deletions

View File

@ -444,7 +444,14 @@ module Vagrant
#
# @return [String]
def read_version
execute("--version").split("r")[0]
# The version string is usually in one of the following formats:
#
# * 4.1.8r1234
# * 4.1.8r1234_OSE
# * 4.1.8_MacPortsr1234
#
# Below accounts for all of these:
execute("--version").split("_")[0].split("r")[0]
end
# Execute the given subcommand for VBoxManage and return the output.