diff --git a/lib/vagrant-cachier/action/configure_bucket_root.rb b/lib/vagrant-cachier/action/configure_bucket_root.rb index 4bd8e67..863fc3f 100644 --- a/lib/vagrant-cachier/action/configure_bucket_root.rb +++ b/lib/vagrant-cachier/action/configure_bucket_root.rb @@ -21,12 +21,13 @@ module VagrantPlugins end def setup_buckets_folder - FileUtils.mkdir_p(cache_root.to_s) unless cache_root.exist? +# FileUtils.mkdir_p(cache_root.to_s) unless cache_root.exist? synced_folder_opts = {id: "vagrant-cache"} synced_folder_opts.merge!(@env[:machine].config.cache.synced_folder_opts || {}) + puts(@env[:machine].config.cache.override_directory) - @env[:machine].config.vm.synced_folder cache_root, '/tmp/vagrant-cache', synced_folder_opts + @env[:machine].config.vm.synced_folder @env[:machine].config.cache.override_directory || cache_root, '/tmp/vagrant-cache', synced_folder_opts @env[:cache_dirs] = [] end diff --git a/lib/vagrant-cachier/config.rb b/lib/vagrant-cachier/config.rb index ad8495c..9ae8dde 100644 --- a/lib/vagrant-cachier/config.rb +++ b/lib/vagrant-cachier/config.rb @@ -1,7 +1,7 @@ module VagrantPlugins module Cachier class Config < Vagrant.plugin(2, :config) - attr_accessor :scope, :auto_detect, :synced_folder_opts + attr_accessor :scope, :auto_detect, :synced_folder_opts, :override_directory attr_reader :buckets ALLOWED_SCOPES = %w( box machine )