mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2025-08-21 04:12:56 +00:00
Formatting
This commit is contained in:
parent
7ec2b19bf3
commit
40b6432f0f
@ -34,7 +34,8 @@ public static partial class Pandoc
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HasPandoc(installDir)) return true;
|
if (HasPandoc(installDir))
|
||||||
|
return true;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -103,21 +104,18 @@ public static partial class Pandoc
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
var subdirectories = Directory.GetDirectories(pandocDirectory);
|
var subdirectories = Directory.GetDirectories(pandocDirectory);
|
||||||
|
|
||||||
foreach (var subdirectory in subdirectories)
|
foreach (var subdirectory in subdirectories)
|
||||||
{
|
{
|
||||||
var pandocPath = Path.Combine(subdirectory, "pandoc.exe");
|
var pandocPath = Path.Combine(subdirectory, "pandoc.exe");
|
||||||
if (File.Exists(pandocPath))
|
if (File.Exists(pandocPath))
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
LOG.LogInformation("Pandoc is not installed in the data directory and might have thrown and error:\n{ErrorMessage}", ex.Message);
|
LOG.LogInformation("Pandoc is not installed in the data directory and might have thrown and error: {0}", ex.Message);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -207,17 +205,16 @@ public static partial class Pandoc
|
|||||||
|
|
||||||
if (!response.IsSuccessStatusCode)
|
if (!response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
LOG.LogError("Code {StatusCode}: Could not fetch Pandoc's latest page:\n {Response}", response.StatusCode, response.RequestMessage);
|
LOG.LogError("Code {StatusCode}: Could not fetch Pandoc's latest page: {Response}", response.StatusCode, response.RequestMessage);
|
||||||
await MessageBus.INSTANCE.SendWarning(new (Icons.Material.Filled.Warning, $"The latest pandoc version was not found, installing version {FALLBACK_VERSION.ToString()} instead."));
|
await MessageBus.INSTANCE.SendWarning(new (Icons.Material.Filled.Warning, $"The latest pandoc version was not found, installing version {FALLBACK_VERSION.ToString()} instead."));
|
||||||
return FALLBACK_VERSION.ToString();
|
return FALLBACK_VERSION.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
var htmlContent = await response.Content.ReadAsStringAsync();
|
var htmlContent = await response.Content.ReadAsStringAsync();
|
||||||
|
|
||||||
var versionMatch = LatestVersionRegex().Match(htmlContent);
|
var versionMatch = LatestVersionRegex().Match(htmlContent);
|
||||||
if (!versionMatch.Success)
|
if (!versionMatch.Success)
|
||||||
{
|
{
|
||||||
LOG.LogError("The latest version regex returned nothing:\n {Value}", versionMatch.Groups.ToString());
|
LOG.LogError("The latest version regex returned nothing: {Value}", versionMatch.Groups.ToString());
|
||||||
await MessageBus.INSTANCE.SendWarning(new (Icons.Material.Filled.Warning, $"The latest pandoc version was not found, installing version {FALLBACK_VERSION.ToString()} instead."));
|
await MessageBus.INSTANCE.SendWarning(new (Icons.Material.Filled.Warning, $"The latest pandoc version was not found, installing version {FALLBACK_VERSION.ToString()} instead."));
|
||||||
return FALLBACK_VERSION.ToString();
|
return FALLBACK_VERSION.ToString();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user