2013-10-21 09:17:59 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module Cachier
|
|
|
|
module Cap
|
|
|
|
module Linux
|
2013-10-22 15:51:45 +00:00
|
|
|
module ComposerPath
|
2013-10-21 09:17:59 +00:00
|
|
|
def self.composer_path(machine)
|
2013-10-22 15:51:45 +00:00
|
|
|
composer_path = nil
|
|
|
|
machine.communicate.tap do |comm|
|
|
|
|
return unless comm.test('which php')
|
2014-09-28 06:03:51 +00:00
|
|
|
# on some VMs an extra new line seems to come out, so we loop over
|
|
|
|
# the output just in case
|
|
|
|
composer_path = ''
|
2013-10-22 15:51:45 +00:00
|
|
|
comm.execute 'echo $HOME' do |buffer, output|
|
2014-09-28 06:03:51 +00:00
|
|
|
composer_path += output.chomp if buffer == :stdout
|
2013-10-22 15:51:45 +00:00
|
|
|
end
|
|
|
|
end
|
2014-07-21 00:11:19 +00:00
|
|
|
return "#{composer_path}/.composer/cache"
|
2013-10-21 09:17:59 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|