feature/recipe_implementation #5
@ -51,7 +51,7 @@ func Load(path string, userParams map[string]any) (*Recipe, error) {
|
|||||||
for _, cmd := range r.AllowedShellCommands {
|
for _, cmd := range r.AllowedShellCommands {
|
||||||
trimmed := strings.TrimSpace(strings.ToLower(cmd))
|
trimmed := strings.TrimSpace(strings.ToLower(cmd))
|
||||||
if !safeReadOnlyCommands[trimmed] && !strings.HasPrefix(trimmed, "git status") && !strings.HasPrefix(trimmed, "git log") {
|
if !safeReadOnlyCommands[trimmed] && !strings.HasPrefix(trimmed, "git status") && !strings.HasPrefix(trimmed, "git log") {
|
||||||
return nil, fmt.Errorf("\u001B[31mERROR: Recipe contains unsafe shell command: %q\u001B[0m Remove or replace the dangerous command and try again", cmd)
|
return nil, fmt.Errorf("\u001B[31mRecipe contains unsafe shell command: %q. Remove or replace the dangerous command in your recipe.\u001B[0m", cmd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user