mirror of
https://github.com/Jguer/yay.git
synced 2025-12-27 10:01:53 -05:00
refactor(yay): move cfg inside of runtime (#2259)
* rework relationship between runtime and cfg * separate runtime from cfg * simplify instantiation logic * move installer to appropriate package * move operator to sync package * add tests for srcinfo service * consolidate srcinfo service in sync * add logger to srcinfo * add logger to preparer * remove unused text functions * remove remaining text.* from srcinfo * remove global logger parts * remove global org method exports * remove global logger * move text->input * add rule to prevent fmt.Print * update golangci go version * remove outdated FAQs * remove outdated FAQs
This commit is contained in:
7
vote.go
7
vote.go
@@ -3,11 +3,12 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/Jguer/aur"
|
||||
"github.com/Jguer/votar/pkg/vote"
|
||||
"github.com/leonelquinteros/gotext"
|
||||
|
||||
"github.com/Jguer/yay/v12/pkg/text"
|
||||
)
|
||||
|
||||
type ErrAURVote struct {
|
||||
@@ -20,7 +21,7 @@ func (e *ErrAURVote) Error() string {
|
||||
}
|
||||
|
||||
func handlePackageVote(ctx context.Context,
|
||||
targets []string, aurClient aur.QueryClient,
|
||||
targets []string, aurClient aur.QueryClient, logger *text.Logger,
|
||||
voteClient *vote.Client, upvote bool,
|
||||
) error {
|
||||
infos, err := aurClient.Get(ctx, &aur.Query{
|
||||
@@ -32,7 +33,7 @@ func handlePackageVote(ctx context.Context,
|
||||
}
|
||||
|
||||
if len(infos) == 0 {
|
||||
fmt.Println(gotext.Get(" there is nothing to do"))
|
||||
logger.Println(gotext.Get(" there is nothing to do"))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user