Skip to content

Commit cb27afb

Browse files
committed
Dirty fix for berkshelf#88
Works for me, on OS X 10.9 with vagrant-vmware-fusion. To install, checkout this branch and run: bundle install bundle exec thor :build vagrant plugin uninstall vagrant-berkshelf vagrant plugin install pkg/vagrant-berkshelf-1.3.7.gem
1 parent 0764707 commit cb27afb

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

lib/berkshelf/vagrant/action/install.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,22 @@ def call(env)
4040
def install(env)
4141
check_vagrant_version(env)
4242
env[:berkshelf].ui.info "Updating Vagrant's berkshelf: '#{env[:berkshelf].shelf}'"
43+
44+
# https://github.com/berkshelf/vagrant-berkshelf/issues/88
45+
# Some of Vagrant's folder sharing methods die when the
46+
# shared folder is deleted and recreated, as Berkshelf
47+
# does. To work around this, we install to a temporary
48+
# location, then use rsync to update the directory shared
49+
# by Vagrant.
50+
real_shelf = env[:berkshelf].shelf
51+
tmp_shelf = "#{real_shelf}-tmp"
52+
4353
opts = {
44-
path: env[:berkshelf].shelf
54+
path: tmp_shelf
4555
}.merge(env[:global_config].berkshelf.to_hash).symbolize_keys!
4656
env[:berkshelf].berksfile.install(opts)
57+
58+
system("rsync -aW --delete #{tmp_shelf}/. #{real_shelf}/.")
4759
end
4860

4961
def warn_disabled_but_berksfile_exists(env)

0 commit comments

Comments
 (0)