mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-17 19:21:36 +00:00
feat(application): enhance watch path parsing to support negation syntax
This commit is contained in:
@@ -1560,9 +1560,17 @@ class Application extends BaseModel
|
||||
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 {
|
||||
|
||||
Reference in New Issue
Block a user