Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
swalkinshaw committed Apr 18, 2017
1 parent 0e953fc commit a8e59f2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Vagrant.configure('2') do |config|
'development' => ['default']
}

ansible.tags = tags if ENV['ANSIBLE_TAGS']
ansible.tags = ENV['ANSIBLE_TAGS']

ansible.extra_vars = {'vagrant_version' => Vagrant::VERSION}
if vars = ENV['ANSIBLE_VARS']
Expand Down Expand Up @@ -155,7 +155,7 @@ Vagrant.configure('2') do |config|
end

def local_provisioning?
Vagrant::Util::Platform.windows? || !which('ansible-playbook') || ENV['FORCE_ANSIBLE_LOCAL']
@local_provisioning ||= Vagrant::Util::Platform.windows? || !which('ansible-playbook') || ENV['FORCE_ANSIBLE_LOCAL']
end

def local_site_path(site)
Expand Down Expand Up @@ -186,12 +186,12 @@ end
def which(cmd)
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']

ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
exts.each do |ext|
exe = File.join(path, "#{cmd}#{ext}")
return exe if File.executable?(exe) && !File.directory?(exe)
end
paths = ENV['PATH'].split(File::PATH_SEPARATOR).flat_map do |path|
exts.map { |ext| File.join(path, "#{cmd}#{ext}") }
end

nil
paths.any? do |path|
next unless File.executable?(path) && !File.directory?(path)
!!system("#{path}", %i(out err) => File::NULL)
end
end

0 comments on commit a8e59f2

Please sign in to comment.