firstRunConfigExists checks whether a cheat config file exists under the given home directory at any of the standard locations.
(home string)
| 291 | // firstRunConfigExists checks whether a cheat config file exists under the |
| 292 | // given home directory at any of the standard locations. |
| 293 | func firstRunConfigExists(home string) bool { |
| 294 | candidates := []string{ |
| 295 | filepath.Join(home, ".config", "cheat", "conf.yml"), |
| 296 | filepath.Join(home, ".cheat", "conf.yml"), |
| 297 | filepath.Join(home, "AppData", "Roaming", "cheat", "conf.yml"), |
| 298 | } |
| 299 | for _, p := range candidates { |
| 300 | if _, err := os.Stat(p); err == nil { |
| 301 | return true |
| 302 | } |
| 303 | } |
| 304 | return false |
| 305 | } |
no outgoing calls
no test coverage detected