Sha256: 5b05b73041927978438367b7f904ce6daeff827791f652e9cfc9caf3f12b8120

Contents?: true

Size: 772 Bytes

Versions: 2

Compression:

Stored size: 772 Bytes

Contents

module Vagrant
  module Notify
    module Action
      class SetSharedFolder
        def initialize(app, env)
          @app = app
        end

        def call(env)         
          begin
            unless env[:machine].config.notify.enable == false 
              host_dir = Pathname("/tmp/vagrant-notify/#{env[:machine].id}")
              FileUtils.mkdir_p host_dir.to_s unless host_dir.exist?
              env[:machine].config.vm.synced_folder host_dir, "/tmp/vagrant-notify", id: "vagrant-notify"
            end
            @app.call(env)
            rescue Vagrant::Errors::GuestCapabilityNotFound
              env[:machine].ui.warn("vagrant-notify: guest does not support the shared folder capability.")
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vagrant-notify-0.5.4 lib/vagrant-notify/action/set_shared_folder.rb
vagrant-notify-0.5.3 lib/vagrant-notify/action/set_shared_folder.rb