Skip to content

Commit

Permalink
Don't abort during AUR search error
Browse files Browse the repository at this point in the history
  • Loading branch information
Morganamilo committed Apr 3, 2018
1 parent c8f6145 commit 5bcb51b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
11 changes: 7 additions & 4 deletions cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 + " ")))

Expand Down
10 changes: 6 additions & 4 deletions query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

Expand Down

0 comments on commit 5bcb51b

Please sign in to comment.