Skip to content

Commit 99a1f38

Browse files
committed
refactor: 增加输出目录配置项
1 parent 8be4fc0 commit 99a1f38

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

tools/BootstrapBlazor.LLMsDocsGenerator/ArgumentsHelper.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ internal static class ArgumentsHelper
1212
public static ParseResult Parse(string[] args)
1313
{
1414
var rootFolderOption = new Option<string?>("--root") { Description = "Set the root folder of project" };
15+
var outputFolderOption = new Option<string?>("--output") { Description = "Set the publish folder of project" };
1516

1617
var rootCommand = new RootCommand("BootstrapBlazor LLMs Documentation Generator")
1718
{
18-
rootFolderOption
19+
rootFolderOption,
20+
outputFolderOption
1921
};
2022

2123
rootCommand.SetAction(async result =>
@@ -26,7 +28,13 @@ public static ParseResult Parse(string[] args)
2628
return;
2729
}
2830

29-
await DocsGenerator.GenerateAllAsync(rootFolder);
31+
var outputFolder = result.GetValue(outputFolderOption);
32+
if (string.IsNullOrEmpty(outputFolder))
33+
{
34+
return;
35+
}
36+
37+
await DocsGenerator.GenerateAllAsync(rootFolder, outputFolder);
3038
});
3139

3240
return rootCommand.Parse(args);

tools/BootstrapBlazor.LLMsDocsGenerator/DocsGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ internal static class DocsGenerator
1010
/// <summary>
1111
/// Generate all documentation files
1212
/// </summary>
13-
public static async Task GenerateAllAsync(string rootFolder)
13+
public static async Task GenerateAllAsync(string rootFolder, string outputFolder)
1414
{
1515
var _sourcePath = Path.Combine(rootFolder, "..", "BootstrapBlazor");
16-
var _outputPath = Path.Combine(rootFolder, "bin", "Release", "net10.0", "publish", "wwwroot", "llms");
16+
var _outputPath = Path.Combine(outputFolder, "wwwroot", "llms");
1717
var _componentsOutputPath = Path.Combine(_outputPath, "components");
1818

1919
Logger($"Source path: {_sourcePath}");

0 commit comments

Comments
 (0)