mirror of
https://github.com/taigrr/wtf
synced 2026-03-29 07:35:16 -07:00
Clean up cfg error handling a bit
Pass in the actual file being used, rather than hardcoded `config.yaml` Differences between two error messages are not that distinct Centralize on one and clean up all the `isCustomConfig` tracking
This commit is contained in:
@@ -84,17 +84,12 @@ func WtfConfigDir() (string, error) {
|
||||
}
|
||||
|
||||
// LoadWtfConfigFile loads the specified config file
|
||||
func LoadWtfConfigFile(filePath string, isCustomConfig bool) *config.Config {
|
||||
func LoadWtfConfigFile(filePath string) *config.Config {
|
||||
absPath, _ := expandHomeDir(filePath)
|
||||
|
||||
cfg, err := config.ParseYamlFile(absPath)
|
||||
if err != nil {
|
||||
if isCustomConfig {
|
||||
displayWtfCustomConfigFileLoadError(err)
|
||||
} else {
|
||||
displayWtfConfigFileLoadError(err)
|
||||
}
|
||||
|
||||
displayWtfConfigFileLoadError(absPath, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user