mirror of
https://github.com/Jguer/yay.git
synced 2025-10-07 00:14:22 -04:00
fix(install): fix missing error display in install
This commit is contained in:
parent
cedbcfbcda
commit
b7f9a5e677
14
cmd.go
14
cmd.go
@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
alpm "github.com/Jguer/go-alpm/v2"
|
||||
"github.com/leonelquinteros/gotext"
|
||||
@ -222,8 +223,17 @@ func handleQuery(ctx context.Context, cmdArgs *parser.Arguments, dbExecutor db.E
|
||||
return printUpdateList(ctx, cmdArgs, dbExecutor, cmdArgs.ExistsDouble("u", "sysupgrade"), filter)
|
||||
}
|
||||
|
||||
return config.Runtime.CmdBuilder.Show(config.Runtime.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, config.Runtime.Mode, settings.NoConfirm))
|
||||
if err := config.Runtime.CmdBuilder.Show(config.Runtime.CmdBuilder.BuildPacmanCmd(ctx,
|
||||
cmdArgs, config.Runtime.Mode, settings.NoConfirm)); err != nil {
|
||||
if str := err.Error(); strings.Contains(str, "exit status") {
|
||||
// yay -Qdt should not output anything in case of error
|
||||
return fmt.Errorf("")
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func handleHelp(ctx context.Context, cmdArgs *parser.Arguments) error {
|
||||
|
@ -262,7 +262,7 @@ func install(ctx context.Context, cmdArgs *parser.Arguments, dbExecutor db.Execu
|
||||
cloned, errA := download.AURPKGBUILDRepos(ctx,
|
||||
config.Runtime.CmdBuilder, toClone, config.AURURL, config.BuildDir, false)
|
||||
if errA != nil {
|
||||
return err
|
||||
return errA
|
||||
}
|
||||
|
||||
var (
|
||||
|
8
main.go
8
main.go
@ -5,7 +5,6 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
pacmanconf "github.com/Morganamilo/go-pacmanconf"
|
||||
"github.com/leonelquinteros/gotext"
|
||||
@ -161,11 +160,10 @@ func main() {
|
||||
}
|
||||
|
||||
defer dbExecutor.Cleanup()
|
||||
err = handleCmd(ctx, cmdArgs, db.Executor(dbExecutor))
|
||||
|
||||
if err != nil {
|
||||
if str := err.Error(); str != "" && !strings.Contains(str, "exit status") {
|
||||
fmt.Fprintln(os.Stderr, str)
|
||||
if err = handleCmd(ctx, cmdArgs, db.Executor(dbExecutor)); err != nil {
|
||||
if str := err.Error(); str != "" {
|
||||
text.Errorln(str)
|
||||
}
|
||||
|
||||
if exitError, ok := err.(*exec.ExitError); ok {
|
||||
|
Loading…
x
Reference in New Issue
Block a user