mirror of
https://github.com/cheat/cheat.git
synced 2026-03-07 03:03:32 +01:00
- cmdInit (--init) now substitutes EDITOR_PATH, PAGER_PATH, and WORK_PATH instead of leaving them as literal strings - Installer now substitutes WORK_PATH and always creates personal and work directories regardless of community cheatsheet choice - When community cheatsheets are declined, the community cheatpath is commented out in the generated config - config.New() skips nonexistent cheatpaths with a warning instead of hard-erroring on EvalSymlinks failure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -189,10 +189,14 @@ cheatpaths:
|
||||
t.Fatalf("failed to write config: %v", err)
|
||||
}
|
||||
|
||||
// Load config with symlink resolution should fail
|
||||
_, err = New(map[string]interface{}{}, configFile, true)
|
||||
if err == nil {
|
||||
t.Error("expected error for broken symlink, got nil")
|
||||
// Load config with symlink resolution should skip the broken cheatpath
|
||||
// (warn to stderr) rather than hard-error
|
||||
conf, err := New(map[string]interface{}{}, configFile, true)
|
||||
if err != nil {
|
||||
t.Errorf("expected no error for broken symlink (should skip), got: %v", err)
|
||||
}
|
||||
if len(conf.Cheatpaths) != 0 {
|
||||
t.Errorf("expected broken cheatpath to be filtered out, got %d cheatpaths", len(conf.Cheatpaths))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user