mirror of
https://github.com/Jguer/yay
synced 2024-08-31 21:58:39 +00:00
fix(yay): display network error on yay number menu, closes #1172
This commit is contained in:
parent
84e872ebe3
commit
4122716ea1
20
cmd.go
20
cmd.go
|
@ -363,10 +363,10 @@ func handleRemove(ctx context.Context, cmdArgs *parser.Arguments, localCache *vc
|
||||||
// NumberMenu presents a CLI for selecting packages to install.
|
// NumberMenu presents a CLI for selecting packages to install.
|
||||||
func displayNumberMenu(ctx context.Context, pkgS []string, dbExecutor db.Executor, cmdArgs *parser.Arguments) error {
|
func displayNumberMenu(ctx context.Context, pkgS []string, dbExecutor db.Executor, cmdArgs *parser.Arguments) error {
|
||||||
var (
|
var (
|
||||||
aurErr, repoErr error
|
aurErr error
|
||||||
aq aurQuery
|
aq aurQuery
|
||||||
pq repoQuery
|
pq repoQuery
|
||||||
lenaq, lenpq int
|
lenaq, lenpq int
|
||||||
)
|
)
|
||||||
|
|
||||||
pkgS = query.RemoveInvalidTargets(pkgS, config.Runtime.Mode)
|
pkgS = query.RemoveInvalidTargets(pkgS, config.Runtime.Mode)
|
||||||
|
@ -379,10 +379,11 @@ func displayNumberMenu(ctx context.Context, pkgS []string, dbExecutor db.Executo
|
||||||
if config.Runtime.Mode.AtLeastRepo() {
|
if config.Runtime.Mode.AtLeastRepo() {
|
||||||
pq = queryRepo(pkgS, dbExecutor)
|
pq = queryRepo(pkgS, dbExecutor)
|
||||||
lenpq = len(pq)
|
lenpq = len(pq)
|
||||||
|
}
|
||||||
|
|
||||||
if repoErr != nil {
|
if aurErr != nil {
|
||||||
return repoErr
|
text.Errorln(gotext.Get("Error during AUR search: %s\n", aurErr))
|
||||||
}
|
text.Warnln(gotext.Get("Showing repo packages only"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if lenpq == 0 && lenaq == 0 {
|
if lenpq == 0 && lenaq == 0 {
|
||||||
|
@ -410,11 +411,6 @@ func displayNumberMenu(ctx context.Context, pkgS []string, dbExecutor db.Executo
|
||||||
return fmt.Errorf(gotext.Get("invalid sort mode. Fix with yay -Y --bottomup --save"))
|
return fmt.Errorf(gotext.Get("invalid sort mode. Fix with yay -Y --bottomup --save"))
|
||||||
}
|
}
|
||||||
|
|
||||||
if aurErr != nil {
|
|
||||||
text.Errorln(gotext.Get("Error during AUR search: %s\n", aurErr))
|
|
||||||
text.Warnln(gotext.Get("Showing repo packages only"))
|
|
||||||
}
|
|
||||||
|
|
||||||
text.Infoln(gotext.Get("Packages to install (eg: 1 2 3, 1-3 or ^4)"))
|
text.Infoln(gotext.Get("Packages to install (eg: 1 2 3, 1-3 or ^4)"))
|
||||||
text.Info()
|
text.Info()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue