Simplify trigger selection
This commit is contained in:
parent
0e5cd900f8
commit
76418b9fcd
|
@ -30,9 +30,7 @@ module Vagrant
|
||||||
# @param [String] guest_name The guest that invoked firing the triggers
|
# @param [String] guest_name The guest that invoked firing the triggers
|
||||||
def fire_before_triggers(action, guest_name)
|
def fire_before_triggers(action, guest_name)
|
||||||
# get all triggers matching action
|
# get all triggers matching action
|
||||||
triggers = config.before_triggers.select do |trigger|
|
triggers = config.before_triggers.select { |t| t.command == action }
|
||||||
trigger.command == action
|
|
||||||
end
|
|
||||||
triggers = filter_triggers(triggers, guest_name)
|
triggers = filter_triggers(triggers, guest_name)
|
||||||
|
|
||||||
binding.pry
|
binding.pry
|
||||||
|
@ -49,10 +47,8 @@ module Vagrant
|
||||||
# @param [Symbol] action Vagrant command to fire trigger on
|
# @param [Symbol] action Vagrant command to fire trigger on
|
||||||
# @param [String] guest_name The guest that invoked firing the triggers
|
# @param [String] guest_name The guest that invoked firing the triggers
|
||||||
def fire_after_triggers(action, guest_name)
|
def fire_after_triggers(action, guest_name)
|
||||||
triggers = []
|
# get all triggers matching action
|
||||||
triggers = config.after_triggers.select do |trigger|
|
triggers = config.after_triggers.select { |t| t.command == action }
|
||||||
trigger.command == action
|
|
||||||
end
|
|
||||||
triggers = filter_triggers(triggers, guest_name)
|
triggers = filter_triggers(triggers, guest_name)
|
||||||
|
|
||||||
binding.pry
|
binding.pry
|
||||||
|
|
Loading…
Reference in New Issue