mirror of
https://github.com/Jguer/yay
synced 2024-10-31 04:12:51 +00:00
fix(vcs): make command error more explicit
This commit is contained in:
parent
d6cb4c50e8
commit
169d5f1f62
1 changed files with 6 additions and 0 deletions
|
@ -4,6 +4,7 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
@ -60,6 +61,11 @@ func (v *InfoStore) getCommit(url, branch string, protocols []string) string {
|
||||||
cmd := v.CmdBuilder.BuildGitCmd("", "ls-remote", protocol+"://"+url, branch)
|
cmd := v.CmdBuilder.BuildGitCmd("", "ls-remote", protocol+"://"+url, branch)
|
||||||
stdout, _, err := v.Runner.Capture(cmd, 5)
|
stdout, _, err := v.Runner.Capture(cmd, 5)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if exiterr, ok := err.(*exec.ExitError); ok && exiterr.ExitCode() == 128 {
|
||||||
|
text.Warnln(gotext.Get("devel check for package failed: '%s' encountered an error", cmd.String()))
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
text.Warnln(err)
|
text.Warnln(err)
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue