Skip to content

Commit

Permalink
Removed fixed path for code and document generation (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
coenm authored Sep 6, 2024
1 parent 4e04403 commit fdd0571
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/RepoM.ActionMenu.CodeGen/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static async Task Main()
Template templateDocs = await LoadTemplateAsync("Templates/DocsScriptVariables.scriban-txt");
Template templatePluginDocs = await LoadTemplateAsync("Templates/DocsPlugin.scriban-txt");

Dictionary<string, string> files = await LoadFiles();
Dictionary<string, string> files = await LoadFilesAsync(rootFolder);

var processedProjects = new Dictionary<string, ProjectDescriptor>();

Expand Down Expand Up @@ -329,13 +329,14 @@ public static async Task<Template> LoadTemplateAsync(string path)
return template;
}

private static async Task<Dictionary<string, string>> LoadFiles()
private static async Task<Dictionary<string, string>> LoadFilesAsync(string root)
{
string[] files = Directory.GetFiles("C:\\Projects\\Private\\git\\RepoM\\docs\\snippets"); // todo coenm
var path = Path.Combine(root, "docs", "snippets");
var fileNames = Directory.GetFiles(path);

var result = new Dictionary<string, string>(files.Length);
var result = new Dictionary<string, string>(fileNames.Length);

foreach (string file in files)
foreach (var file in fileNames)
{
var f = new FileInfo(file);
var fileContent = await File.ReadAllTextAsync(file);
Expand Down

0 comments on commit fdd0571

Please sign in to comment.