Skip to content

Commit 0b1b4c6

Browse files
theletterfMpdreamz
andauthored
Update src/tooling/docs-assembler/Cli/RepositoryCommands.cs
Co-authored-by: Martijn Laarman <[email protected]>
1 parent 69b7055 commit 0b1b4c6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/tooling/docs-assembler/Cli/RepositoryCommands.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,18 @@ private static async Task EnhanceLlmsTxtFile(AssembleContext context, GlobalNavi
289289
{
290290
var llmsTxtPath = Path.Combine(context.OutputDirectory.FullName, "docs", "llms.txt");
291291

292-
if (!File.Exists(llmsTxtPath))
292+
var readFs = context.ReadFileSystem;
293+
if (!readFs.File.Exists(llmsTxtPath))
293294
return; // No llms.txt file to enhance
294295

295-
var existingContent = await File.ReadAllTextAsync(llmsTxtPath, ctx);
296+
var existingContent = await readFs.File.ReadAllTextAsync(llmsTxtPath, ctx);
296297
var navigationSections = enhancer.GenerateNavigationSections(navigation);
297298

298299
// Append the navigation sections to the existing boilerplate
299300
var enhancedContent = existingContent + Environment.NewLine + navigationSections;
300301

301-
await File.WriteAllTextAsync(llmsTxtPath, enhancedContent, Encoding.UTF8, ctx);
302+
var writeFs = context.WriteFileSystem;
303+
await writeFs.File.WriteAllTextAsync(llmsTxtPath, enhancedContent, Encoding.UTF8, ctx);
304+
302305
}
303306
}

0 commit comments

Comments
 (0)