Update FileSystemEventBookmark.cs (#2577)

Fixes #2527
This commit is contained in:
Sipke Schoorstra 2021-12-10 15:57:47 +01:00 committed by GitHub
parent 1f94b977f4
commit 38004f60ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,9 +48,11 @@ namespace Elsa.Activities.File.Bookmarks
var changeTypes = await context.ReadActivityPropertyAsync(a => a.ChangeTypes, cancellationToken);
var notifyFilters = await context.ReadActivityPropertyAsync(a => a.NotifyFilters, cancellationToken);
var path = await context.ReadActivityPropertyAsync(a => a.Path, cancellationToken);
var pattern = await context.ReadActivityPropertyAsync(a => a.Pattern, cancellationToken);
var pattern = NormalizeWildcard(await context.ReadActivityPropertyAsync(a => a.Pattern, cancellationToken));
var result = Result(new FileSystemEventBookmark(path, pattern, changeTypes, notifyFilters));
return new[] { result };
}
private static string? NormalizeWildcard(string? pattern) => pattern == "*.*" ? "*" : pattern;
}
}