Skip to content

Commit

Permalink
[Backport] #243 to rel/2.2.x (#244)
Browse files Browse the repository at this point in the history
Hotfix for bot file properties being not found on linux

Co-authored-by: Sella-GH <147769367+Sella-GH@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and Sella-GH authored Dec 23, 2024
1 parent 534ed15 commit 4ae4dd0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/AzzyBot.Core/Utilities/SoftwareStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public static DateTimeOffset GetAppUptime()

private static string GetAppFilePath()
{
using Process app = Process.GetCurrentProcess();

string? fileName = app.MainModule?.FileName;
string fileName = Path.Combine(AppContext.BaseDirectory, AppDomain.CurrentDomain.FriendlyName);
if (!HardwareStats.CheckIfLinuxOs)
fileName += ".exe";

return (!string.IsNullOrEmpty(fileName))
? Path.Combine(AppContext.BaseDirectory, fileName)
Expand Down

0 comments on commit 4ae4dd0

Please sign in to comment.