mirror of
https://github.com/Jguer/yay
synced 2024-10-05 23:59:13 +00:00
Print error if PATH is empty.
This fixes #881. Before: ```bash $ PATH= /usr/bin/yay -Qu $ echo $? 1 ``` After: ```bash $ PATH= ./yay -Qu exec: "pacman-conf": executable file not found in $PATH $ echo $? 1 ```
This commit is contained in:
parent
607d28778e
commit
24edabe5df
6
main.go
6
main.go
|
@ -30,7 +30,11 @@ func initAlpm(cmdArgs *settings.Arguments, pacmanConfigPath string) (*pacmanconf
|
|||
|
||||
pacmanConf, stderr, err := pacmanconf.PacmanConf("--config", pacmanConfigPath, "--root", root)
|
||||
if err != nil {
|
||||
return nil, false, fmt.Errorf("%s", stderr)
|
||||
cmdErr := err
|
||||
if stderr != "" {
|
||||
cmdErr = fmt.Errorf("%s\n%s", err, stderr)
|
||||
}
|
||||
return nil, false, cmdErr
|
||||
}
|
||||
|
||||
if dbPath, _, exists := cmdArgs.GetArg("dbpath", "b"); exists {
|
||||
|
|
|
@ -22,11 +22,7 @@ type OSRunner struct {
|
|||
|
||||
func (r *OSRunner) Show(cmd *exec.Cmd) error {
|
||||
cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
return fmt.Errorf("")
|
||||
}
|
||||
return nil
|
||||
return cmd.Run()
|
||||
}
|
||||
|
||||
func (r *OSRunner) Capture(cmd *exec.Cmd, timeout int64) (stdout, stderr string, err error) {
|
||||
|
|
Loading…
Reference in a new issue