cmdInit displays an example config file.
(home string, envvars map[string]string)
| 11 | |
| 12 | // cmdInit displays an example config file. |
| 13 | func cmdInit(home string, envvars map[string]string) { |
| 14 | |
| 15 | // identify the os-specific paths at which configs may be located |
| 16 | confpaths, err := config.Paths(runtime.GOOS, home, envvars) |
| 17 | if err != nil { |
| 18 | fmt.Fprintf(os.Stderr, "failed to read config paths: %v\n", err) |
| 19 | os.Exit(1) |
| 20 | } |
| 21 | |
| 22 | confpath := confpaths[0] |
| 23 | |
| 24 | // expand template placeholders and comment out community cheatpath |
| 25 | configs := installer.ExpandTemplate(configs(), confpath) |
| 26 | configs = installer.CommentCommunity(configs, confpath) |
| 27 | |
| 28 | // output the templated configs |
| 29 | fmt.Println(configs) |
| 30 | } |
no test coverage detected