"Disable" composer bucket if php is not installed
This commit is contained in:
parent
a0a164cf2b
commit
f8e419b8b6
1 changed files with 9 additions and 3 deletions
|
@ -4,8 +4,14 @@ module VagrantPlugins
|
|||
module Linux
|
||||
module ComposerPath
|
||||
def self.composer_path(machine)
|
||||
composer_path = '/home/vagrant/.composer'
|
||||
return composer_path
|
||||
composer_path = nil
|
||||
machine.communicate.tap do |comm|
|
||||
return unless comm.test('which php')
|
||||
comm.execute 'echo $HOME' do |buffer, output|
|
||||
composer_path = output.chomp if buffer == :stdout
|
||||
end
|
||||
end
|
||||
return "#{composer_path}/.composer"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue