add GitHubRepository
This commit is contained in:
parent
8558c279fc
commit
457ef18cdc
5 changed files with 125 additions and 22 deletions
|
|
@ -99,3 +99,19 @@ func newRemote(name string, urlMap map[string]string) (Remote, error) {
|
|||
|
||||
return r, nil
|
||||
}
|
||||
|
||||
// GuessRemote attempts to select and return the remote a user likely wants to target when dealing with GitHub repositories.
|
||||
func GuessRemote() (Remote, error) {
|
||||
|
||||
remotes, err := Remotes()
|
||||
if err != nil {
|
||||
return Remote{}, err
|
||||
}
|
||||
|
||||
if len(remotes) == 0 {
|
||||
return Remote{}, fmt.Errorf("unable to guess remote")
|
||||
}
|
||||
|
||||
// lol
|
||||
return remotes[0], nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue