Permalink
Browse files

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
  • Loading branch information...
zts committed Dec 27, 2013
1 parent 0764707 commit cb27afb4d95a1d56a87a9777814716e36650265e
Showing with 13 additions and 1 deletion.
  1. +13 −1 lib/berkshelf/vagrant/action/install.rb
@@ -40,10 +40,22 @@ def call(env)
def install(env)
check_vagrant_version(env)
env[:berkshelf].ui.info "Updating Vagrant's berkshelf: '#{env[:berkshelf].shelf}'"
# https://github.com/berkshelf/vagrant-berkshelf/issues/88
# Some of Vagrant's folder sharing methods die when the
# shared folder is deleted and recreated, as Berkshelf
# does. To work around this, we install to a temporary
# location, then use rsync to update the directory shared
# by Vagrant.
real_shelf = env[:berkshelf].shelf
tmp_shelf = "#{real_shelf}-tmp"
opts = {
path: env[:berkshelf].shelf
path: tmp_shelf
}.merge(env[:global_config].berkshelf.to_hash).symbolize_keys!
env[:berkshelf].berksfile.install(opts)
system("rsync -aW --delete #{tmp_shelf}/. #{real_shelf}/.")
end
def warn_disabled_but_berksfile_exists(env)

0 comments on commit cb27afb

Please sign in to comment.