diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e2738e..cebf2d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [unreleased] + +### Breaking changes +- Removed support for reading from STDIN. This will affect linux users launching via legendary. + - Instead of piping legendary's arguments into min-ed-launcher, use command substitution instead + + `WINEPREFIX=/your/wine/prefix /path/to/MinEdLauncher $(legendary launch --dry-run 9c203b6ed35846e8a4a9ff1e314f6593 2>&1 | grep "Launch parameters" | cut -d':' -f 3-) /autorun /edh4 /autoquit` + +### Bug Fixes +- Fixed an issue where the launcher would hang because no data was available in STDIN. + ## [0.7.5] - 2022-11-21 ### Bug Fixes diff --git a/README.md b/README.md index d3545a4..ac5ec95 100644 --- a/README.md +++ b/README.md @@ -121,9 +121,9 @@ Either configure the Epic client and use the provided Bootstrap exe or use [lege This method utilizes [legendary]. 1. Ensure you've authenticated, installed Elite Dangerous via [legendary] and setup your wine prefix -2. Use the `--dry-run` flag and pipe the arguments to `MinEdLauncher` +2. Use the `--dry-run` flag and pass the arguments to `MinEdLauncher` via command substitution ```sh - legendary launch --dry-run 9c203b6ed35846e8a4a9ff1e314f6593 2> >(grep "Launch parameters") | cut -d':' -f 3- | WINEPREFIX=/your/wine/prefix /path/to/MinEdLauncher /autorun /edh /autoquit + WINEPREFIX=/your/wine/prefix /path/to/MinEdLauncher $(legendary launch --dry-run 9c203b6ed35846e8a4a9ff1e314f6593 2>&1 | grep "Launch parameters" | cut -d':' -f 3-) /autorun /edh /autoquit ``` #### Frontier diff --git a/src/MinEdLauncher/Program.fs b/src/MinEdLauncher/Program.fs index 396cf75..3799e76 100644 --- a/src/MinEdLauncher/Program.fs +++ b/src/MinEdLauncher/Program.fs @@ -5,7 +5,6 @@ open System.Collections open System.IO open System.Net.Http open System.Reflection -open System.Text.RegularExpressions open System.Threading open FsConfig open FsToolkit.ErrorHandling @@ -48,21 +47,6 @@ let logRuntimeInfo version args = Env: %s{envVars} """ -let applyStdin argv = - if Console.IsInputRedirected then - let input = Console.ReadLine() - if input <> null then - Log.debug $"STDIN: {input}" - let stdin = - Regex.Matches(input, @"[^\s""']+|""([^""]*)""|'([^']*)'", RegexOptions.Multiline) - |> Seq.filter (fun m -> not <| String.IsNullOrEmpty(m.Value)) - |> Seq.map (fun m -> m.Value.Trim('\'', '"')) - |> Seq.toArray - Array.append stdin argv - else - argv - else argv - [] let main argv = use cts = new CancellationTokenSource() @@ -70,12 +54,11 @@ let main argv = try let assembly = Assembly.GetExecutingAssembly() let version = assembly.GetCustomAttribute().InformationalVersion - let args = applyStdin argv - logRuntimeInfo version args + logRuntimeInfo version argv let run = - getSettings assembly args + getSettings assembly argv |> TaskResult.bind (fun settings -> taskResult { Log.debug $"Settings: %A{settings}"