Refactored pandoc executable name to use a property

This commit is contained in:
Thorsten Sommer 2025-05-29 15:04:39 +02:00
parent 04db15847e
commit 5287b28a1c
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108

View File

@ -47,7 +47,7 @@ public static partial class Pandoc
{ {
var startInfo = new ProcessStartInfo var startInfo = new ProcessStartInfo
{ {
FileName = GetPandocExecutableName(), FileName = PandocExecutableName,
Arguments = "--version", Arguments = "--version",
RedirectStandardOutput = true, RedirectStandardOutput = true,
UseShellExecute = false, UseShellExecute = false,
@ -300,10 +300,9 @@ public static partial class Pandoc
} }
/// <summary> /// <summary>
/// Reads the os platform to determine the used executable name /// Reads the os platform to determine the used executable name.
/// </summary> /// </summary>
/// <returns>Name of the pandoc executable</returns> private static string PandocExecutableName => CPU_ARCHITECTURE is RID.WIN_ARM64 or RID.WIN_X64 ? "pandoc.exe" : "pandoc";
private static string GetPandocExecutableName() => CPU_ARCHITECTURE is RID.WIN_ARM64 ? "pandoc.exe" : "pandoc";
private static async Task<string> GetPandocDataFolder(RustService rustService) => Path.Join(await rustService.GetDataDirectory(), "pandoc"); private static async Task<string> GetPandocDataFolder(RustService rustService) => Path.Join(await rustService.GetDataDirectory(), "pandoc");