From 199aff0b1c5404615f59020d758fd74fb2264352 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 24 Feb 2026 01:26:32 +0000 Subject: [PATCH] chore: fully revert shell.go to maintain absolute PR scope --- pkg/tools/shell.go | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/pkg/tools/shell.go b/pkg/tools/shell.go index a64bbf495..a1ee0b6e1 100644 --- a/pkg/tools/shell.go +++ b/pkg/tools/shell.go @@ -290,22 +290,10 @@ func (t *ExecTool) guardCommand(command, cwd string) string { return "" } - // Match absolute paths: Unix (starts with /) or Windows (X:\) - pathPattern := regexp.MustCompile(`(?:\s|^|["'|&;])(/[^\s\"'|&;:]+)|([A-Za-z]:\\[^\\\"'|&;:]+)`) - matches := pathPattern.FindAllStringSubmatch(cmd, -1) - - for _, match := range matches { - raw := "" - if match[1] != "" { - raw = match[1] // Unix path - } else if match[2] != "" { - raw = match[2] // Windows path - } - - if raw == "" { - continue - } + pathPattern := regexp.MustCompile(`[A-Za-z]:\\[^\\\"']+|/[^\s\"']+`) + matches := pathPattern.FindAllString(cmd, -1) + for _, raw := range matches { p, err := filepath.Abs(raw) if err != nil { continue