Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 cb27afb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/berkshelf/vagrant/action/install.rb
Expand Up @@ -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)
Expand Down

0 comments on commit cb27afb

Please sign in to comment.