More Options To Specify Repo (#178)
use active user as owner by default Fix #163 Part1 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/178 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: mrsdizzie <info@mrsdizzie.com>
This commit is contained in:
@@ -100,12 +100,15 @@ func init() {
|
||||
yamlConfigPath = filepath.Join(dir, "tea.yml")
|
||||
}
|
||||
|
||||
func splitRepo(repoPath string) (string, string) {
|
||||
func getOwnerAndRepo(repoPath, user string) (string, string) {
|
||||
if len(repoPath) == 0 {
|
||||
return "", ""
|
||||
}
|
||||
p := strings.Split(repoPath, "/")
|
||||
if len(p) >= 2 {
|
||||
return p[0], p[1]
|
||||
}
|
||||
return repoPath, ""
|
||||
return user, repoPath
|
||||
}
|
||||
|
||||
func getActiveLogin() (*Login, error) {
|
||||
|
||||
Reference in New Issue
Block a user