vagrant-cachier-ng/lib/vagrant-cachier/cap/linux/maven_cache_dir.rb

21 lines
548 B
Ruby
Raw Normal View History

2016-05-01 09:55:40 -07:00
module VagrantPlugins
module Cachier
module Cap
module Linux
module MavenCacheDir
def self.maven_cache_dir(machine)
maven_cache_dir = nil
machine.communicate.tap do |comm|
return unless comm.test('which mvn')
comm.execute 'echo $HOME' do |buffer, output|
maven_cache_dir = output.chomp if buffer == :stdout
end
end
return "#{maven_cache_dir}/.m2/repository"
end
end
end
end
end
end