Bugfixes for initCommand (#156)
respect --login parameter again 🚀 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/156 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
2135af0304
commit
08a9a9a8ab
11
cmd/flags.go
11
cmd/flags.go
|
@ -81,10 +81,21 @@ var AllDefaultFlags = append([]cli.Flag{
|
|||
|
||||
// initCommand returns repository and *Login based on flags
|
||||
func initCommand() (*Login, string, string) {
|
||||
err := loadConfig(yamlConfigPath)
|
||||
if err != nil {
|
||||
log.Fatal("load config file failed ", yamlConfigPath)
|
||||
}
|
||||
|
||||
login, repoPath, err := curGitRepoPath(repoValue)
|
||||
if err != nil {
|
||||
log.Fatal(err.Error())
|
||||
}
|
||||
|
||||
if loginValue != "" {
|
||||
login = getLoginByName(loginValue)
|
||||
if login == nil {
|
||||
log.Fatal("Login name " + loginValue + " does not exist")
|
||||
}
|
||||
}
|
||||
|
||||
owner, repo := splitRepo(repoPath)
|
||||
|
|
Loading…
Reference in New Issue