mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 06:22:50 +08:00
This reverts commit ffecbed43a33d65280a8ce90f98819a5ca24473d.
This commit is contained in:
parent
ffecbed43a
commit
60e3a3737a
@ -40,13 +40,15 @@ namespace Ocelot.DependencyInjection
|
|||||||
|
|
||||||
const string globalConfigFile = "ocelot.global.json";
|
const string globalConfigFile = "ocelot.global.json";
|
||||||
|
|
||||||
string subConfigPattern = $@"^ocelot\.([a-zA-Z0-9]+|[a-zA-Z0-9]+\.{env?.EnvironmentName})\.json$";
|
const string subConfigPattern = @"^ocelot\.[a-zA-Z0-9]+\.json$";
|
||||||
|
|
||||||
|
string excludeConfigName = env?.EnvironmentName != null ? $"ocelot.{env.EnvironmentName}.json" : string.Empty;
|
||||||
|
|
||||||
var reg = new Regex(subConfigPattern, RegexOptions.IgnoreCase | RegexOptions.Singleline);
|
var reg = new Regex(subConfigPattern, RegexOptions.IgnoreCase | RegexOptions.Singleline);
|
||||||
|
|
||||||
var files = new DirectoryInfo(folder)
|
var files = new DirectoryInfo(folder)
|
||||||
.EnumerateFiles()
|
.EnumerateFiles()
|
||||||
.Where(fi => reg.IsMatch(fi.Name))
|
.Where(fi => reg.IsMatch(fi.Name) && (fi.Name != excludeConfigName))
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
var fileConfiguration = new FileConfiguration();
|
var fileConfiguration = new FileConfiguration();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user