Skip to content

Commit

Permalink
fix: --tas does not work properly if path include space on Linux (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
DemoJameson committed Dec 13, 2023
1 parent 2e0b542 commit 4072159
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using Celeste;
Expand Down Expand Up @@ -38,11 +39,17 @@ private static void ParseArgs() {

if (arg == "--tas" && queue.Count >= 1) {
string tasPath = queue.Dequeue();

// fix: https://github.com/EverestAPI/CelesteTAS-EverestInterop/issues/62
while (Environment.OSVersion.Platform != PlatformID.Win32NT && queue.Count >= 1 && !tasPath.EndsWith(".tas", StringComparison.OrdinalIgnoreCase)) {
tasPath += " " + queue.Dequeue();
}

if (File.Exists(tasPath)) {
InputController.StudioTasFilePath = tasPath;
WaitToPlayTas = true;
} else {
$"TAS file '{tasPath}' not exist.".Log(LogLevel.Warn);
$"TAS file '{tasPath}' does not exist.".Log(LogLevel.Warn);
}
}
}
Expand Down

0 comments on commit 4072159

Please sign in to comment.