"Disable" composer bucket if php is not installed

This commit is contained in:
Fabio Rehm 2013-10-22 13:51:45 -02:00
parent a0a164cf2b
commit f8e419b8b6

View file

@ -4,8 +4,14 @@ module VagrantPlugins
module Linux module Linux
module ComposerPath module ComposerPath
def self.composer_path(machine) def self.composer_path(machine)
composer_path = '/home/vagrant/.composer' composer_path = nil
return composer_path 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 end
end end