fix: better error messages for missing repos
continuous-integration/drone/push Build is failing Details

This commit is contained in:
decentral1se 2021-11-02 13:36:40 +01:00
parent f833ccb864
commit 3b77607f36
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 5 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package git
import (
"fmt"
"os"
"path/filepath"
"strings"
"github.com/go-git/go-git/v5"
@ -24,6 +25,10 @@ func Clone(dir, url string) error {
ReferenceName: plumbing.ReferenceName("refs/heads/main"),
})
if err != nil {
if strings.Contains(err.Error(), "authentication required") {
name := filepath.Base(dir)
return fmt.Errorf("unable to clone %s, does %s exist?", name, url)
}
return err
}
}