Merge pull request #124 from neerolyte/composer_home_resolution
Resolve $HOME even if VM spits bogus new lines
This commit is contained in:
commit
babc7e09ff
1 changed files with 4 additions and 1 deletions
|
@ -7,8 +7,11 @@ module VagrantPlugins
|
||||||
composer_path = nil
|
composer_path = nil
|
||||||
machine.communicate.tap do |comm|
|
machine.communicate.tap do |comm|
|
||||||
return unless comm.test('which php')
|
return unless comm.test('which php')
|
||||||
|
# on some VMs an extra new line seems to come out, so we loop over
|
||||||
|
# the output just in case
|
||||||
|
composer_path = ''
|
||||||
comm.execute 'echo $HOME' do |buffer, output|
|
comm.execute 'echo $HOME' do |buffer, output|
|
||||||
composer_path = output.chomp if buffer == :stdout
|
composer_path += output.chomp if buffer == :stdout
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return "#{composer_path}/.composer/cache"
|
return "#{composer_path}/.composer/cache"
|
||||||
|
|
Loading…
Reference in a new issue