rewrote config file path search (#219)

added comment to clarify coding choices

added package xdg to vendor folder

rewrote config file path search

Co-authored-by: crapStone <crapstone01@gmail.com>
Reviewed-on: https://gitea.com/gitea/tea/pulls/219
Reviewed-by: 6543 <6543@noreply.gitea.io>
Reviewed-by: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
crapStone
2020-10-06 13:06:47 +00:00
committed by 6543
parent cbd1bccbf9
commit c4e2db32b5
19 changed files with 1059 additions and 120 deletions

View File

@ -131,7 +131,7 @@ func AddLogin(name, token, user, passwd, sshKey, giteaURL string, insecure bool)
err := LoadConfig()
if err != nil {
log.Fatal("Unable to load config file " + yamlConfigPath)
log.Fatal(err)
}
for _, l := range Config.Logins {
@ -253,7 +253,7 @@ func InitCommand(repoValue, loginValue, remoteValue string) (*Login, string, str
err := LoadConfig()
if err != nil {
log.Fatal("load config file failed ", yamlConfigPath)
log.Fatal(err)
}
if login, err = GetDefaultLogin(); err != nil {
@ -287,7 +287,7 @@ func InitCommand(repoValue, loginValue, remoteValue string) (*Login, string, str
func InitCommandLoginOnly(loginValue string) *Login {
err := LoadConfig()
if err != nil {
log.Fatal("load config file failed ", yamlConfigPath)
log.Fatal(err)
}
var login *Login