First shot at adding a config option to override the directory used on the host machine
This commit is contained in:
parent
a0cdcb05a2
commit
f74a13ce22
2 changed files with 4 additions and 3 deletions
lib/vagrant-cachier
|
@ -21,12 +21,13 @@ module VagrantPlugins
|
||||||
end
|
end
|
||||||
|
|
||||||
def setup_buckets_folder
|
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 = {id: "vagrant-cache"}
|
||||||
synced_folder_opts.merge!(@env[:machine].config.cache.synced_folder_opts || {})
|
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] = []
|
@env[:cache_dirs] = []
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
module VagrantPlugins
|
module VagrantPlugins
|
||||||
module Cachier
|
module Cachier
|
||||||
class Config < Vagrant.plugin(2, :config)
|
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
|
attr_reader :buckets
|
||||||
|
|
||||||
ALLOWED_SCOPES = %w( box machine )
|
ALLOWED_SCOPES = %w( box machine )
|
||||||
|
|
Loading…
Reference in a new issue