lib/vagrant-notify/action.rb in vagrant-notify-0.2.2 vs lib/vagrant-notify/action.rb in vagrant-notify-0.3.0
- old
+ new
@@ -6,9 +6,22 @@
require_relative 'action/stop_server'
module Vagrant
module Notify
module Action
+ class SetSharedFolder
+ def initialize(app, env)
+ @app = app
+ end
+
+ def call(env)
+ 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"
+ @app.call(env)
+ end
+ end
+
class << self
Call = Vagrant::Action::Builtin::Call
def action_start_server
Vagrant::Action::Builder.new.tap do |b|