diff --git a/pkg/tools/shell.go b/pkg/tools/shell.go index c23734577..994535462 100644 --- a/pkg/tools/shell.go +++ b/pkg/tools/shell.go @@ -407,10 +407,6 @@ func (t *ExecTool) guardCommand(command, cwd string) string { } } - if !isPathBoundary(cmd, loc[0]) { - continue - } - p, err := filepath.Abs(raw) if err != nil { continue @@ -420,6 +416,10 @@ func (t *ExecTool) guardCommand(command, cwd string) string { continue } + if !isPathBoundary(cmd, loc[0]) { + continue + } + rel, err := filepath.Rel(cwdPath, p) if err != nil { continue