diff --git a/GitUpdateChecker.exe b/GitUpdateChecker.exe index d5a5b7d..36ed7c3 100644 Binary files a/GitUpdateChecker.exe and b/GitUpdateChecker.exe differ diff --git a/git.go b/git.go index d16cde5..096924d 100644 --- a/git.go +++ b/git.go @@ -69,6 +69,23 @@ func checkRepo(cfg RepoConfig) RepoResult { res.Path = local if _, err := os.Stat(filepath.Join(local, ".git")); os.IsNotExist(err) { + // Vérifier que le dépôt distant existe avant de proposer le clone + code, _, stderr := runGit([]string{"ls-remote", "--exit-code", cfg.URL}, "", 15*time.Second) + if code != 0 { + for _, kw := range []string{"could not resolve", "connection refused", "unable to connect", "timed out", "the remote end hung up"} { + if strings.Contains(strings.ToLower(stderr), kw) { + res.Offline = true + res.Error = "Hors ligne" + return res + } + } + if strings.Contains(strings.ToLower(stderr), "not found") || strings.Contains(strings.ToLower(stderr), "repository not found") { + res.Error = "Dépôt introuvable : " + cfg.URL + return res + } + res.Error = "Erreur remote : " + stderr + return res + } res.NeedsClone = true return res } diff --git a/gui.go b/gui.go index c2117a2..1b59ce8 100644 --- a/gui.go +++ b/gui.go @@ -522,7 +522,7 @@ func (a *App) doAction() { a.mw.Synchronize(func() { if err != nil { a.model.setProgress(idx, 0, "Erreur") - walk.MsgBox(a.mw, "Erreur", res.Name+"\n\n"+err.Error(), walk.MsgBoxIconError) + a.appendLog(fmt.Sprintf("[%s] Erreur: %v", res.Name, err)) logError(fmt.Sprintf("[%s] %v", res.Name, err)) } else { a.model.setProgress(idx, 1.0, progressBarText(1.0, 20, "Terminé")) diff --git a/main.go b/main.go index 52ac29e..ba55f33 100644 --- a/main.go +++ b/main.go @@ -9,7 +9,7 @@ import ( "github.com/lxn/walk" ) -const VERSION = "0.7.3" +const VERSION = "0.7.4" func exeDir() string { exe, err := os.Executable() diff --git a/version.txt b/version.txt index f38fc53..0a1ffad 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.7.3 +0.7.4