mirror of
https://gitea.com/gitea/tea.git
synced 2024-11-03 04:27:21 -05:00
Respect Flag Variable repoValue (#183)
Flags respect repoValue followup of #178 Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/183 Reviewed-by: lafriks <lafriks@noreply.gitea.io> Reviewed-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
3c1bcdb1e2
commit
83b94ab864
10
cmd/flags.go
10
cmd/flags.go
@ -83,10 +83,8 @@ var AllDefaultFlags = append([]cli.Flag{
|
||||
|
||||
// initCommand returns repository and *Login based on flags
|
||||
func initCommand() (*Login, string, string) {
|
||||
var (
|
||||
login *Login
|
||||
repoPath string
|
||||
)
|
||||
var login *Login
|
||||
|
||||
err := loadConfig(yamlConfigPath)
|
||||
if err != nil {
|
||||
log.Fatal("load config file failed ", yamlConfigPath)
|
||||
@ -102,7 +100,7 @@ func initCommand() (*Login, string, string) {
|
||||
}
|
||||
|
||||
if exist || len(repoValue) == 0 {
|
||||
login, repoPath, err = curGitRepoPath(repoValue)
|
||||
login, repoValue, err = curGitRepoPath(repoValue)
|
||||
if err != nil {
|
||||
log.Fatal(err.Error())
|
||||
}
|
||||
@ -115,7 +113,7 @@ func initCommand() (*Login, string, string) {
|
||||
}
|
||||
}
|
||||
|
||||
owner, repo := getOwnerAndRepo(repoPath, login.User)
|
||||
owner, repo := getOwnerAndRepo(repoValue, login.User)
|
||||
return login, owner, repo
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user