Skip to content

Commit

Permalink
Merge pull request #199 from BR0kEN-/issues/198
Browse files Browse the repository at this point in the history
Resolves #198: Fix plugin operability while working with a multi-machine Vagrantfile
  • Loading branch information
cgsmith authored Apr 5, 2021
2 parents b1d37fe + ae799d5 commit caf9e52
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/vagrant-hostsupdater/Action/BaseAction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@ def initialize(app, env)
end

def call(env)
if not @@completed.key?(self.class.name)
# Check whether the plugin has been executed for a particular
# VM as it may happen that a single Vagrantfile defines multiple
# machines and having a static flag will result in a plugin being
# executed just once.
# https://github.com/agiledivider/vagrant-hostsupdater/issues/198
if not @@completed.key?(@machine.name)
run(env)
@@completed[self.class.name] = true
@@completed[@machine.name] = true
end

@app.call(env)
Expand Down

0 comments on commit caf9e52

Please sign in to comment.