Explorar el Código

fix(vcs): make command error more explicit

jguer hace 3 años
padre
commit
169d5f1f62
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      pkg/vcs/vcs.go

+ 6 - 0
pkg/vcs/vcs.go

@@ -4,6 +4,7 @@ import (
 	"encoding/json"
 	"fmt"
 	"os"
+	"os/exec"
 	"strings"
 	"sync"
 
@@ -60,6 +61,11 @@ func (v *InfoStore) getCommit(url, branch string, protocols []string) string {
 		cmd := v.CmdBuilder.BuildGitCmd("", "ls-remote", protocol+"://"+url, branch)
 		stdout, _, err := v.Runner.Capture(cmd, 5)
 		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)
 			return ""
 		}