Module: VagrantPlugins::Cachier::Cap::Linux::NpmCacheDir

Defined in:
lib/vagrant-cachier/cap/linux/npm_cache_dir.rb

Class Method Summary collapse

Class Method Details

.npm_cache_dir(machine) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/vagrant-cachier/cap/linux/npm_cache_dir.rb', line 6

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