Merge pull request #286 from Morganamilo/noerr

Suppress pacman error printing
This commit is contained in:
J Guerreiro 2018-03-25 18:05:25 +02:00 committed by GitHub
commit 91eb2585e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 2 deletions

6
cmd.go
View file

@ -462,7 +462,11 @@ func passToPacman(args *arguments) error {
cmd.Stdin, cmd.Stdout, cmd.Stderr = os.Stdin, os.Stdout, os.Stderr
err := cmd.Run()
return err
if err != nil {
return fmt.Errorf("")
}
return nil
}
//passToPacman but return the output instead of showing the user

View file

@ -203,7 +203,10 @@ func main() {
err = handleCmd()
if err != nil {
if err.Error() != "" {
fmt.Println(err)
}
status = 1
goto cleanup
}

View file

@ -333,8 +333,28 @@ func printUpdateList(parser *arguments) error {
}
}
missing := false
outer:
for pkg := range parser.targets {
for _, name := range localNames {
if name == pkg {
continue outer
}
}
for _, name := range remoteNames {
if name == pkg {
continue outer
}
}
fmt.Println(red(bold("error:")), "package '"+pkg+"' was not found")
missing = true
}
if missing {
return fmt.Errorf("")
}
return nil