mirror of
https://github.com/gabrie30/ghorg.git
synced 2026-05-05 11:56:09 +02:00
Fix Gitea tokens not being found in config.yaml file (#287)
* Adds support for Gitea options in config.yaml file * Remove debug lines --------- Co-authored-by: anon <anon@desktop.localdomain>
This commit is contained in:
parent
e470b44967
commit
7f324eac85
@ -238,6 +238,8 @@ func InitConfig() {
|
||||
getOrSetDefaults("GHORG_RECLONE_PATH")
|
||||
getOrSetDefaults("GHORG_QUIET")
|
||||
getOrSetDefaults("GHORG_GIT_FILTER")
|
||||
getOrSetDefaults("GHORG_GITEA_TOKEN")
|
||||
getOrSetDefaults("GHORG_INSECURE_GITEA_CLIENT")
|
||||
|
||||
if os.Getenv("GHORG_DEBUG") != "" {
|
||||
viper.Debug()
|
||||
|
||||
@ -168,6 +168,8 @@ func GetOrSetToken() {
|
||||
getOrSetGitLabToken()
|
||||
case "bitbucket":
|
||||
getOrSetBitBucketToken()
|
||||
default:
|
||||
getOrSetGiteaToken()
|
||||
}
|
||||
}
|
||||
|
||||
@ -227,6 +229,18 @@ func getOrSetBitBucketToken() {
|
||||
}
|
||||
}
|
||||
|
||||
func getOrSetGiteaToken() {
|
||||
var token string
|
||||
token = os.Getenv("GHORG_GITEA_TOKEN")
|
||||
|
||||
if isZero(token) || len(token) != 40 {
|
||||
if runtime.GOOS == "windows" {
|
||||
return
|
||||
}
|
||||
os.Setenv("GHORG_GITEA_TOKEN", token)
|
||||
}
|
||||
}
|
||||
|
||||
// VerifyTokenSet checks to make sure env is set for the correct scm provider
|
||||
func VerifyTokenSet() error {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user