"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

@ -2,10 +2,16 @@ module VagrantPlugins
module Cachier
module Cap
module Linux
module ComposerPath
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