feat(application): enhance watch path parsing to support negation syntax
This commit is contained in:
parent
72619cbd36
commit
54f6813f29
1 changed files with 9 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue