()
| 53 | } |
| 54 | |
| 55 | func initConfig() { |
| 56 | // Don't override if already set in tests |
| 57 | if globalCfg != nil { |
| 58 | return |
| 59 | } |
| 60 | |
| 61 | if configFile == "" { |
| 62 | globalCfg = config.New(repoRoot()) |
| 63 | } else { |
| 64 | var err error |
| 65 | globalCfg, err = config.NewFromFile(repoRoot(), configFile) |
| 66 | if err != nil { |
| 67 | fmt.Printf("FAIL: Could not load config file: %s\n", err.Error()) |
| 68 | os.Exit(1) |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | func repoRoot() string { |
| 74 | dir, err := os.Getwd() |
nothing calls this directly
no test coverage detected