Move location of command validator

This commit is contained in:
Brian Cain 2018-03-19 15:34:35 -07:00
parent 6cbb5d8e5d
commit abb6d77442
No known key found for this signature in database
GPG Key ID: 43D51080D357A001
1 changed files with 5 additions and 5 deletions

View File

@ -136,6 +136,11 @@ module VagrantPlugins
commands.push(key) commands.push(key)
end end
if !commands.include?(@command)
machine.ui.warn(I18n.t("vagrant.config.triggers.bad_command_warning",
cmd: @command))
end
# TODO: Does it make sense to strip out the "shell provisioner" error key here? # TODO: Does it make sense to strip out the "shell provisioner" error key here?
# We could add more context around triggers? # We could add more context around triggers?
if @run if @run
@ -148,11 +153,6 @@ module VagrantPlugins
errors.concat errorz["shell provisioner"] if !errorz.empty? errors.concat errorz["shell provisioner"] if !errorz.empty?
end end
if !commands.include?(@command)
machine.ui.warn(I18n.t("vagrant.config.triggers.bad_command_warning",
cmd: @command))
end
if !@name.nil? && !@name.is_a?(String) if !@name.nil? && !@name.is_a?(String)
errors << I18n.t("vagrant.config.triggers.name_bad_type", cmd: @command) errors << I18n.t("vagrant.config.triggers.name_bad_type", cmd: @command)
end end