fix: better error messages for missing repos
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
f833ccb864
commit
3b77607f36
@ -3,6 +3,7 @@ package git
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/go-git/go-git/v5"
|
"github.com/go-git/go-git/v5"
|
||||||
@ -24,6 +25,10 @@ func Clone(dir, url string) error {
|
|||||||
ReferenceName: plumbing.ReferenceName("refs/heads/main"),
|
ReferenceName: plumbing.ReferenceName("refs/heads/main"),
|
||||||
})
|
})
|
||||||
if err != nil {
|
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
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user