Merge pull request #1928 from korya/master

When top-of-branch vagrant tries to execute a command, which does not exist in PATH, error report does not display the executable name.
This commit is contained in:
Mitchell Hashimoto 2013-07-16 16:34:02 -07:00
commit 51d4cc4068
2 changed files with 5 additions and 4 deletions

View File

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

View File

@ -168,11 +168,11 @@ en:
%{help} %{help}
command_unavailable: |- 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 found in the PATH variable. This is an error. Please verify
this software is installed and on the path. this software is installed and on the path.
command_unavailable_windows: |- 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 found in the %PATH% variable. This is an error. Please verify
this software is installed and on the path. this software is installed and on the path.
config_invalid: |- config_invalid: |-