From 5bcb51bf00786571e5c4324ad6c4ac5a8bb999ab Mon Sep 17 00:00:00 2001 From: morganamilo Date: Tue, 3 Apr 2018 06:49:41 +0100 Subject: [PATCH] Don't abort during AUR search error --- cmd.go | 11 +++++++---- query.go | 10 ++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/cmd.go b/cmd.go index 1bae5fcf..94de5b39 100644 --- a/cmd.go +++ b/cmd.go @@ -360,10 +360,7 @@ func handleRemove() (err error) { // NumberMenu presents a CLI for selecting packages to install. func numberMenu(pkgS []string, flags []string) (err error) { - aurQ, err := narrowSearch(pkgS, true) - if err != nil { - return fmt.Errorf("Error during AUR search: %s", err) - } + aurQ, aurErr := narrowSearch(pkgS, true) numaq := len(aurQ) repoQ, numpq, err := queryRepo(pkgS) if err != nil { @@ -382,6 +379,12 @@ func numberMenu(pkgS []string, flags []string) (err error) { aurQ.printSearch(numpq + 1) } + + if aurErr != nil { + fmt.Printf("Error during AUR search: %s\n", aurErr) + fmt.Println("Showing repo packages only") + } + fmt.Println(bold(green(arrow + " Packages to install (eg: 1 2 3, 1-3 or ^4)"))) fmt.Print(bold(green(arrow + " "))) diff --git a/query.go b/query.go index d4fcc45e..8fcb2e82 100644 --- a/query.go +++ b/query.go @@ -130,10 +130,7 @@ func narrowSearch(pkgS []string, sortS bool) (aurQuery, error) { // SyncSearch presents a query to the local repos and to the AUR. func syncSearch(pkgS []string) (err error) { - aq, err := narrowSearch(pkgS, true) - if err != nil { - return err - } + aq, aurErr := narrowSearch(pkgS, true) pq, _, err := queryRepo(pkgS) if err != nil { return err @@ -147,6 +144,11 @@ func syncSearch(pkgS []string) (err error) { aq.printSearch(1) } + if aurErr != nil { + fmt.Printf("Error during AUR search: %s\n", aurErr) + fmt.Println("Showing Repo packags only") + } + return nil }