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:
6543
2020-09-16 13:47:52 +00:00
parent f47ac8f96e
commit 3c1bcdb1e2
3 changed files with 45 additions and 4 deletions

View File

@@ -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) {