diff --git a/Nodsoft.MoltenObsidian.Tool/Commands/SSG/GenerateStaticSiteCommand.cs b/Nodsoft.MoltenObsidian.Tool/Commands/SSG/GenerateStaticSiteCommand.cs index 33e1c89..258c2b1 100644 --- a/Nodsoft.MoltenObsidian.Tool/Commands/SSG/GenerateStaticSiteCommand.cs +++ b/Nodsoft.MoltenObsidian.Tool/Commands/SSG/GenerateStaticSiteCommand.cs @@ -96,12 +96,12 @@ await AnsiConsole.Status().StartAsync("Generating static assets.", async ctx => if (settings.DebugMode) { - AnsiConsole.Console.MarkupLine(/*lang=markdown*/$"[grey]Ignoring folders:[/] {string.Join("[grey], [/]", settings.IgnoredFolders ?? new[] { "*None*" })}"); - AnsiConsole.Console.MarkupLine(/*lang=markdown*/$"[grey]Ignoring files:[/] {string.Join("[grey], [/]", settings.IgnoredFiles ?? new[] { "*None*" })}"); + AnsiConsole.Console.MarkupLine(/*lang=md*/$"[grey]Ignoring folders:[/] {string.Join("[grey], [/]", settings.IgnoredFolders ?? new[] { "*None*" })}"); + AnsiConsole.Console.MarkupLine(/*lang=md*/$"[grey]Ignoring files:[/] {string.Join("[grey], [/]", settings.IgnoredFiles ?? new[] { "*None*" })}"); AnsiConsole.Console.MarkupLine(settings.OutputPath is null - ? /*lang=markdown*/$"[grey]Output path defaulted to current directory: [/]{Environment.CurrentDirectory}" - : /*lang=markdown*/$"[grey]Output path set: [/]{settings.OutputPath}" + ? /*lang=md*/$"[grey]Output path defaulted to current directory: [/]{Environment.CurrentDirectory}" + : /*lang=md*/$"[grey]Output path set: [/]{settings.OutputPath}" ); } @@ -116,19 +116,12 @@ await AnsiConsole.Status().StartAsync("Generating static assets.", async ctx => } List fileData = await StaticSiteGenerator.CreateOutputFilesAsync(settings.OutputPath!.ToString(), pathFilePair); - - // foreach((FileInfo file, byte[] data) in fileData) - // { - // await WriteDataAsync(file, data); - // } - await Task.WhenAll(fileData.Select(WriteDataAsync)); } - AnsiConsole.Console.MarkupLine(/*lang=markdown*/$"Wrote manifest to [green link]{settings.OutputPath}[/]."); + AnsiConsole.Console.MarkupLine(/*lang=md*/$"Wrote static files to [green link]{settings.OutputPath}[/]."); }); - return 0; } @@ -138,7 +131,7 @@ private static async Task WriteDataAsync(InfoDataPair pair) { pair.FileInfo.Directory.Create(); } - await using FileStream stream = pair.FileInfo.Open(FileMode.OpenOrCreate, FileAccess.Write); + await using FileStream stream = pair.FileInfo.Open(FileMode.Create, FileAccess.Write); await stream.WriteAsync(pair.FileData); await stream.FlushAsync();