()
| 19 | var Commands = NewRegistry() |
| 20 | |
| 21 | func initI18nFunc() bool { |
| 22 | config, err := configv3.LoadConfig() |
| 23 | |
| 24 | var configErrTemplate string |
| 25 | if err != nil { |
| 26 | if ce, ok := err.(translatableerror.EmptyConfigError); ok { |
| 27 | configErrTemplate = ce.Error() |
| 28 | } else { |
| 29 | fmt.Println(FailureColor("FAILED")) |
| 30 | fmt.Println("Error read/writing config: ", err.Error()) |
| 31 | os.Exit(1) |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | T = Init(config) |
| 36 | |
| 37 | if err != nil { |
| 38 | msg := T(configErrTemplate, map[string]interface{}{ |
| 39 | "FilePath": configv3.ConfigFilePath(), |
| 40 | }) |
| 41 | fmt.Fprintf(os.Stderr, "%s\n", msg) |
| 42 | } |
| 43 | return true |
| 44 | } |
| 45 | |
| 46 | type registry struct { |
| 47 | cmd map[string]Command |
no test coverage detected