2014-03-23 20:16:18 +00:00
|
|
|
module VagrantPlugins
|
|
|
|
module Cachier
|
|
|
|
class Bucket
|
|
|
|
class Generic < Bucket
|
|
|
|
def install
|
2014-04-13 20:17:26 +00:00
|
|
|
|
|
|
|
# First we normalize the @configs hash as a hash of hashes
|
2014-03-23 20:16:18 +00:00
|
|
|
if @configs.has_key?(:cache_dir)
|
2014-04-13 20:17:26 +00:00
|
|
|
@configs = { @name => @configs }
|
2014-04-07 00:26:26 +00:00
|
|
|
end
|
2014-04-13 20:17:26 +00:00
|
|
|
|
|
|
|
# Now we iterate through all generic buckets's configurations and
|
|
|
|
# set them up.
|
|
|
|
@configs.each do |key, conf|
|
|
|
|
if conf.has_key?(:cache_dir)
|
|
|
|
symlink(conf[:cache_dir], "/tmp/vagrant-cache/#{key}")
|
|
|
|
else
|
|
|
|
@env[:ui].info I18n.t('vagrant_cachier.skipping_bucket', bucket: "Generic[#{key}]")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-03-23 20:16:18 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|