зеркало из https://github.com/mislav/hub.git
Ensure that "command not found" error is printed on stderr
Otherwise, for example, a `browse` command would have failed silently if
the program for the browser couldn't be found.
Ref. f507de0596
Fixes #1289
This commit is contained in:
Родитель
b78bc1d1e1
Коммит
854d86ccbe
|
@ -77,7 +77,10 @@ func (cmd *Cmd) Exec() error {
|
|||
|
||||
binary, err := exec.LookPath(cmd.Name)
|
||||
if err != nil {
|
||||
return fmt.Errorf("command not found: %s", cmd.Name)
|
||||
return &exec.Error{
|
||||
Name: cmd.Name,
|
||||
Err: fmt.Errorf("command not found"),
|
||||
}
|
||||
}
|
||||
|
||||
args := []string{binary}
|
||||
|
|
Загрузка…
Ссылка в новой задаче