chore(loader): add logging for safe commands config loading
Add debug print statements to indicate when the safe commands config file is successfully loaded or when falling back to the built-in list.
This commit is contained in:
parent
f9d99527e0
commit
d74c613e0f
@ -21,6 +21,7 @@ var safeCommands = sync.OnceValue(func() map[string]bool {
|
|||||||
data, err := os.ReadFile(cfgPath)
|
data, err := os.ReadFile(cfgPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Fallback to a built-in safe list
|
// Fallback to a built-in safe list
|
||||||
|
fmt.Println("Could not read safe shell commands config, using built-in fallback")
|
||||||
return map[string]bool{
|
return map[string]bool{
|
||||||
"ls": true, "pwd": true, "cat": true, "tree": true,
|
"ls": true, "pwd": true, "cat": true, "tree": true,
|
||||||
"find": true, "grep": true, "rg": true,
|
"find": true, "grep": true, "rg": true,
|
||||||
@ -30,7 +31,9 @@ var safeCommands = sync.OnceValue(func() map[string]bool {
|
|||||||
"pytest": true, "poetry run pytest": true, "ctest": true,
|
"pytest": true, "poetry run pytest": true, "ctest": true,
|
||||||
"python -m pytest": true, "python": true, "poetry": true,
|
"python -m pytest": true, "python": true, "poetry": true,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
fmt.Println("Using safe shell commands config:", cfgPath)
|
||||||
|
|
||||||
var cfg struct {
|
var cfg struct {
|
||||||
SafeCommands []string `yaml:"safe_commands"`
|
SafeCommands []string `yaml:"safe_commands"`
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user