Skip to content

Commit

Permalink
Tidy up path handling
Browse files Browse the repository at this point in the history
  • Loading branch information
valters-tomsons committed May 17, 2024
1 parent d147d0a commit 0725812
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/DayZLauncher.UnixPatcher.Utils/UnixJunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@ public static class UnixJunctions
{
private static bool IsRunningOnMono => Type.GetType("Mono.Runtime") != null;

private static readonly string GamePath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
private static readonly string LinuxLauncherDataPath = GamePath + @"\LinuxLauncherData";

private static readonly bool EnableDebugLogging = Environment.GetEnvironmentVariable("DAYZLAUNCHER_UNIX_LOGS") is not null;
private static readonly string DebugLogFilePath = LinuxLauncherDataPath + @"\launcher.log";

static UnixJunctions()
{
if (IsRunningOnMono)
{
Console.WriteLine("UnixJunctions: running on Mono runtime!");
Directory.CreateDirectory(LinuxLauncherDataPath);
}
}

Expand Down Expand Up @@ -100,8 +106,8 @@ private static string RunShellCommand(string command, string arguments)
Directory.CreateDirectory(basePath);

string uniqueId = Guid.NewGuid().ToString("N");
string tempOutputPath = basePath + @$"\tmp_output_{uniqueId}.txt";
string lockFilePath = basePath + @$"\{uniqueId}.lock";
string tempOutputPath = LinuxLauncherDataPath + @$"\tmp_output_{uniqueId}.txt";
string lockFilePath = LinuxLauncherDataPath + @$"\{uniqueId}.lock";

Console.WriteLine($"UnixJunctions.RunShellCommand: tempOutputPath='{tempOutputPath}'");

Expand Down

0 comments on commit 0725812

Please sign in to comment.