Skip to content

Commit

Permalink
Merge pull request #2718 from Varying-Vagrant-Vagrants/fix/parallels-…
Browse files Browse the repository at this point in the history
…docker-detection

Improve docker/parallels detection
  • Loading branch information
tomjn authored Jul 19, 2024
2 parents f375014 + e10bc48 commit bca99e4
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,13 @@ end


def vvv_is_docker_present()
VagrantPlugins::DockerProvider::Driver.new.execute("docker", "version")
return true
rescue Vagrant::Errors::CommandUnavailable
return false
if `docker version`
return true
end
end

def vvv_is_parallels_present()
VagrantPlugins::DockerProvider::Driver.new.execute("prctl", "version")
return true
rescue Vagrant::Errors::CommandUnavailable
return false
return Vagrant.has_plugin?("vagrant-parallels")
end

vagrant_dir = __dir__
Expand Down Expand Up @@ -348,7 +344,7 @@ if show_logo
when 'hyperv'
provider_version = 'n/a'
when 'docker'
provider_version = VagrantPlugins::DockerProvider::Driver.new.execute("docker", "-v").gsub("Docker version ", "")
provider_version = `docker -v`.gsub("Docker version ", "")
else
provider_version = '??'
end
Expand Down

0 comments on commit bca99e4

Please sign in to comment.