Vagrant reports properly error for not found command

This commit is contained in:
korya 2013-07-15 08:52:53 +03:00
parent 0dfc6455ae
commit a0774b5b5f
2 changed files with 5 additions and 4 deletions

View File

@ -25,12 +25,13 @@ module Vagrant
end
def initialize(*command)
progname = command[0]
@options = command.last.is_a?(Hash) ? command.pop : {}
@command = command
@command[0] = Which.which(@command[0]) if !File.file?(@command[0])
if !@command[0]
raise Errors::CommandUnavailableWindows, file: command[0] if Platform.windows?
raise Errors::CommandUnavailable, file: command[0]
raise Errors::CommandUnavailableWindows, file: progname if Platform.windows?
raise Errors::CommandUnavailable, file: progname
end
@logger = Log4r::Logger.new("vagrant::util::subprocess")

View File

@ -168,11 +168,11 @@ en:
%{help}
command_unavailable: |-
The executable '%(file)' Vagrant is trying to run was not
The executable '%{file}' Vagrant is trying to run was not
found in the PATH variable. This is an error. Please verify
this software is installed and on the path.
command_unavailable_windows: |-
The executable '%(file)' Vagrant is trying to run was not
The executable '%{file}' Vagrant is trying to run was not
found in the %PATH% variable. This is an error. Please verify
this software is installed and on the path.
config_invalid: |-