26.04.17 작업 진행 사항
This commit is contained in:
@@ -8,6 +8,13 @@ namespace Tornado3_2026Election.Services;
|
||||
|
||||
public sealed class KarismaSceneVariableCatalog
|
||||
{
|
||||
private static readonly string[] PreferredReportNames =
|
||||
[
|
||||
"TSCN_VARIABLE_DISCOVERY_ELECT2026_NORMAL.md",
|
||||
"TSCN_VARIABLE_DISCOVERY_E_DRIVE.md",
|
||||
"TSCN_VARIABLE_DISCOVERY.md"
|
||||
];
|
||||
|
||||
private static readonly IReadOnlyDictionary<string, KarismaSceneVariableDefinition> EmptySceneVariables =
|
||||
new Dictionary<string, KarismaSceneVariableDefinition>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
@@ -179,10 +186,19 @@ public sealed class KarismaSceneVariableCatalog
|
||||
var current = startPath;
|
||||
for (var depth = 0; depth < 8 && !string.IsNullOrWhiteSpace(current); depth++)
|
||||
{
|
||||
var candidate = Path.Combine(current, "TSCN_VARIABLE_DISCOVERY_E_DRIVE.md");
|
||||
if (File.Exists(candidate))
|
||||
foreach (var reportName in PreferredReportNames)
|
||||
{
|
||||
return candidate;
|
||||
var candidate = Path.Combine(current, reportName);
|
||||
if (File.Exists(candidate))
|
||||
{
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
|
||||
var wildcardCandidate = TryFindLatestDiscoveryReport(current);
|
||||
if (!string.IsNullOrWhiteSpace(wildcardCandidate))
|
||||
{
|
||||
return wildcardCandidate;
|
||||
}
|
||||
|
||||
current = Path.GetDirectoryName(current);
|
||||
@@ -206,6 +222,22 @@ public sealed class KarismaSceneVariableCatalog
|
||||
return roots;
|
||||
}
|
||||
|
||||
private static string? TryFindLatestDiscoveryReport(string directoryPath)
|
||||
{
|
||||
try
|
||||
{
|
||||
return Directory.EnumerateFiles(directoryPath, "TSCN_VARIABLE_DISCOVERY*.md", SearchOption.TopDirectoryOnly)
|
||||
.Where(path => !Path.GetFileName(path).Contains("SAMPLE", StringComparison.OrdinalIgnoreCase))
|
||||
.OrderByDescending(path => File.GetLastWriteTimeUtc(path))
|
||||
.ThenBy(path => path, StringComparer.OrdinalIgnoreCase)
|
||||
.FirstOrDefault();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static string NormalizeRelativePath(string relativePath)
|
||||
{
|
||||
return relativePath
|
||||
|
||||
Reference in New Issue
Block a user