From 54f6813f2956ea2abb3351e5f16c150ade127ff1 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Fri, 26 Sep 2025 13:05:29 +0200 Subject: [PATCH] feat(application): enhance watch path parsing to support negation syntax --- app/Models/Application.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Models/Application.php b/app/Models/Application.php index 6541d7336..51abd60d6 100644 --- a/app/Models/Application.php +++ b/app/Models/Application.php @@ -1560,9 +1560,17 @@ private function parseWatchPaths($value) if ($value) { $watch_paths = collect(explode("\n", $value)) ->map(function (string $path): string { - // Trim whitespace and remove leading slashes to normalize paths + // Trim whitespace $path = trim($path); + if (str_starts_with($path, '!')) { + $negation = '!'; + $pathWithoutNegation = substr($path, 1); + $pathWithoutNegation = ltrim(trim($pathWithoutNegation), '/'); + + return $negation.$pathWithoutNegation; + } + return ltrim($path, '/'); }) ->filter(function (string $path): bool {