mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-23 00:32:50 +08:00
#296 remembered how to regex
This commit is contained in:
parent
e94df4749c
commit
2b8c905a26
@ -30,12 +30,12 @@ namespace Ocelot.DependencyInjection
|
||||
|
||||
public static IConfigurationBuilder AddOcelot(this IConfigurationBuilder builder)
|
||||
{
|
||||
const string pattern = "(?i)ocelot(.*).json$";
|
||||
const string pattern = "(?i)ocelot.([a-zA-Z0-9]*).json";
|
||||
|
||||
var reg = new Regex(pattern);
|
||||
|
||||
var files = Directory.GetFiles(".")
|
||||
.Where(path => reg.IsMatch(path)).Where(x => x.Count(s => s == '.') == 3)
|
||||
.Where(path => reg.IsMatch(path))
|
||||
.ToList();
|
||||
|
||||
var fileConfiguration = new FileConfiguration();
|
||||
|
Loading…
x
Reference in New Issue
Block a user