Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit 0da90e2

Browse files
committed
Drop host composer dependency
1 parent 1c53c9b commit 0da90e2

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Vagrantfile

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ if File.exist?("#{host_project_dir}/composer.json")
1313
cconfig = load_composer_config("#{host_project_dir}/composer.json")
1414

1515
# If Drupal VM is a Composer dependency set the correct path.
16-
vendor_dir = `composer config vendor-dir`.strip
1716
drupalvm_path = "#{vendor_dir}/geerlingguy/drupal-vm"
1817
if Dir.exist?("#{host_project_dir}/#{drupalvm_path}")
1918
host_drupalvm_dir = "#{host_project_dir}/#{drupalvm_path}"

lib/drupalvm/vagrant.rb

+10
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ def ansible_version
6666
/^[^\s]+ (.+)$/.match(`#{ansible_bin} --version`) { |match| return match[1] }
6767
end
6868

69+
# Return the path to the composer executable
70+
def composer_bin
71+
@composer_bin ||= which('composer')
72+
end
73+
74+
# Return Composer's vendor directory.
75+
def vendor_dir
76+
@vendor_dir ||= composer_bin ? `#{composer_bin} config vendor-dir`.strip : 'vendor'
77+
end
78+
6979
# Require that if installed, the ansible version meets the requirements.
7080
def require_ansible_version(requirement)
7181
return unless ansible_bin

0 commit comments

Comments
 (0)