gitea-sonarqube-bot/cmd/gitea-sonarqube-bot/main.go
justusbunsi 5c6229be8f
Allow custom config path via environment variable
Signed-off-by: Steven Kriegler <61625851+justusbunsi@users.noreply.github.com>
2021-06-20 15:39:54 +02:00

22 lines
355 B
Go

package main
import (
"os"
"path"
"github.com/justusbunsi/gitea-sonarqube-pr-bot/internal/settings"
)
func GetConfigLocation() string {
configPath := path.Join("config")
if customConfigPath, ok := os.LookupEnv("PRBOT_CONFIG_PATH"); ok {
configPath = customConfigPath
}
return configPath
}
func main() {
settings.Load(GetConfigLocation())
}