vagrant-cachier-ng/lib/vagrant-cachier/cap/linux/npm_cache_dir.rb
George Miroshnykov ee6174d33c Add npm support
2013-10-23 16:18:42 +03:00

20 lines
528 B
Ruby

module VagrantPlugins
module Cachier
module Cap
module Linux
module NpmCacheDir
def self.npm_cache_dir(machine)
npm_cache_dir = nil
machine.communicate.tap do |comm|
return unless comm.test('which npm')
comm.execute 'npm config get cache' do |buffer, output|
npm_cache_dir = output.chomp if buffer == :stdout
end
end
return npm_cache_dir
end
end
end
end
end
end