mirror of https://github.com/cheat/cheat.git
fix: logging on failed configs
Fixes an issue whereby the error message generated when a config file could not be loaded (due to a symlink resolution failure) would fail to print the config file path to `stderr`.
This commit is contained in:
parent
bbf6af50b1
commit
ca91b25b02
|
@ -75,14 +75,16 @@ func New(opts map[string]interface{}, confPath string, resolve bool) (Config, er
|
||||||
// `resolve` is a switch that allows us to turn off symlink resolution when
|
// `resolve` is a switch that allows us to turn off symlink resolution when
|
||||||
// running the config tests.
|
// running the config tests.
|
||||||
if resolve {
|
if resolve {
|
||||||
expanded, err = filepath.EvalSymlinks(expanded)
|
evaled, err := filepath.EvalSymlinks(expanded)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return Config{}, fmt.Errorf(
|
return Config{}, fmt.Errorf(
|
||||||
"failed to resolve symlink: %s, %v",
|
"failed to resolve symlink: %s: %v",
|
||||||
expanded,
|
expanded,
|
||||||
err,
|
err,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
expanded = evaled
|
||||||
}
|
}
|
||||||
|
|
||||||
conf.Cheatpaths[i].Path = expanded
|
conf.Cheatpaths[i].Path = expanded
|
||||||
|
|
Loading…
Reference in New Issue