feat(application): enhance watch path parsing to support negation syntax

This commit is contained in:
Andras Bacsai 2025-09-26 13:05:29 +02:00
parent 72619cbd36
commit 54f6813f29

View file

@ -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 {