EnsureConfigPath works out the config path, then creates the directory to make sure that it exists
()
| 88 | |
| 89 | // EnsureConfigPath works out the config path, then creates the directory to make sure that it exists |
| 90 | func EnsureConfigPath() (string, error) { |
| 91 | configPath, err := getConfigPath() |
| 92 | if err != nil { |
| 93 | return "", err |
| 94 | } |
| 95 | err = os.MkdirAll(configPath, os.ModePerm) |
| 96 | if err != nil { |
| 97 | return "", err |
| 98 | } |
| 99 | return configPath, nil |
| 100 | } |
| 101 | |
| 102 | // getConfigPath works out the directory where the config file should be saved and returns it. |
| 103 | // does not modify the global viper |
no test coverage detected