mirror of
				https://github.com/cheat/cheat.git
				synced 2025-11-04 07:45:28 +01:00 
			
		
		
		
	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:
		@@ -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
 | 
			
		||||
		// running the config tests.
 | 
			
		||||
		if resolve {
 | 
			
		||||
			expanded, err = filepath.EvalSymlinks(expanded)
 | 
			
		||||
			evaled, err := filepath.EvalSymlinks(expanded)
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				return Config{}, fmt.Errorf(
 | 
			
		||||
					"failed to resolve symlink: %s, %v",
 | 
			
		||||
					"failed to resolve symlink: %s: %v",
 | 
			
		||||
					expanded,
 | 
			
		||||
					err,
 | 
			
		||||
				)
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			expanded = evaled
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		conf.Cheatpaths[i].Path = expanded
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user