DebugProxyPass dynamic server_name
This commit is contained in:
parent
cf531cff36
commit
2f65dd3120
8
.vscode/launch.json
vendored
8
.vscode/launch.json
vendored
@ -11,6 +11,14 @@
|
||||
"preLaunchTask": "build",
|
||||
"program": "${workspaceFolder}/bin/Debug/net8.0/win-x64/File-Folder-Helper.dll",
|
||||
"args": [
|
||||
"s",
|
||||
"X",
|
||||
"L:/Git/Linux-Ubuntu-Server/etc/nginx/include",
|
||||
"Day-Helper-2024-09-16",
|
||||
"*.conf",
|
||||
"/etc/nginx/include/",
|
||||
"server_name",
|
||||
"proxy_pass~root",
|
||||
"s",
|
||||
"X",
|
||||
"L:/DevOps/Mesa_FI/MesaFabApproval/Fab2ApprovalTests/Programmability/Functions",
|
||||
|
@ -7,34 +7,38 @@ internal static partial class Helper20240916
|
||||
internal static void DebugProxyPass(ILogger<Worker> logger, List<string> args)
|
||||
{
|
||||
string debug;
|
||||
string domain;
|
||||
string[] lines;
|
||||
string fileName;
|
||||
string[] segments;
|
||||
string domain = args[5];
|
||||
string includePath = args[3];
|
||||
string searchString = args[4];
|
||||
string searchPattern = args[2];
|
||||
string fileNameWithoutExtension;
|
||||
string[] searchPatterns = args[4].Split('|');
|
||||
string[] searchStrings = args[5].Split('~');
|
||||
string sourceDirectory = Path.GetFullPath(args[0]);
|
||||
string[] files = Directory.GetFiles(sourceDirectory, searchPattern, SearchOption.AllDirectories);
|
||||
logger.LogInformation("With search pattern '{SearchPattern}' found {files} file(s)", searchPattern, files.Length);
|
||||
foreach (string file in files)
|
||||
{
|
||||
debug = string.Empty;
|
||||
domain = string.Empty;
|
||||
lines = File.ReadAllLines(file);
|
||||
fileNameWithoutExtension = Path.GetFileNameWithoutExtension(file);
|
||||
fileName = Path.GetFileName(file);
|
||||
foreach (string line in lines)
|
||||
{
|
||||
segments = line.Split(searchPatterns, StringSplitOptions.None);
|
||||
segments = line.Split(searchString, StringSplitOptions.None);
|
||||
if (segments.Length > 1 && segments[1][0] is ' ' or '\t')
|
||||
domain = segments[1].Trim();
|
||||
segments = line.Split(searchStrings, StringSplitOptions.None);
|
||||
if (segments.Length < 2)
|
||||
continue;
|
||||
if (segments[1][0] is not ' ' and not '\t')
|
||||
continue;
|
||||
debug = segments[1].Trim();
|
||||
}
|
||||
logger.LogInformation("{includePath}{fileNameWithoutExtension}; # https://{fileNameWithoutExtension}.{domain} # {debug}",
|
||||
logger.LogInformation("include {includePath}{fileName}; # https://{domain} # {debug}",
|
||||
includePath,
|
||||
fileNameWithoutExtension,
|
||||
fileNameWithoutExtension,
|
||||
fileName,
|
||||
domain,
|
||||
debug);
|
||||
}
|
||||
|
@ -124,6 +124,12 @@ internal static partial class Helper20241108
|
||||
{
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(WorkItem[]))]
|
||||
private partial class WorkItemCollectionSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
|
||||
private record Record(WorkItem WorkItem, WorkItem? Parent, Record[]? Children, Record[]? Related, Record[]? Successors)
|
||||
{
|
||||
|
||||
@ -326,7 +332,7 @@ internal static partial class Helper20241108
|
||||
else
|
||||
{
|
||||
string json = File.ReadAllText(checkFile);
|
||||
results = JsonSerializer.Deserialize<WorkItem[]>(json);
|
||||
results = JsonSerializer.Deserialize(json, WorkItemCollectionSourceGenerationContext.Default.WorkItemArray);
|
||||
}
|
||||
return results is null ? null : new(results);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user