mirror of
https://github.com/cooperspencer/gickup.git
synced 2025-05-11 17:55:34 +02:00
Sourcehut (#123)
* added createorg to gogs * added sourcehut capabilities * fix variable names * added sourcehut to readme
This commit is contained in:
parent
8a84f57965
commit
fa2dfd4434
7 changed files with 348 additions and 4 deletions
22
gogs/gogs.go
22
gogs/gogs.go
|
@ -26,10 +26,24 @@ func Backup(r types.Repo, d types.GenRepo, dry bool) {
|
|||
if d.User != "" {
|
||||
user, err = gogsclient.GetUserInfo(d.User)
|
||||
if err != nil {
|
||||
log.Fatal().
|
||||
Str("stage", "gogs").
|
||||
Str("url", d.URL).
|
||||
Msgf("couldn't find %s", d.User)
|
||||
if d.CreateOrg {
|
||||
org, err := gogsclient.CreateOrg(gogs.CreateOrgOption{
|
||||
UserName: d.User,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatal().
|
||||
Str("stage", "gogs").
|
||||
Str("url", d.URL).
|
||||
Msg(err.Error())
|
||||
}
|
||||
user.ID = org.ID
|
||||
user.UserName = org.UserName
|
||||
} else {
|
||||
log.Fatal().
|
||||
Str("stage", "gogs").
|
||||
Str("url", d.URL).
|
||||
Msg(err.Error())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue