From d095ccf668d971a968db8221fc3173cd9a8cd7ee Mon Sep 17 00:00:00 2001 From: Taryn Hill Date: Fri, 10 Mar 2017 21:37:47 -0600 Subject: [PATCH] Utility: Get mod search paths from env MOD_SEARCH_PATHS --- OpenRA.Utility/Program.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenRA.Utility/Program.cs b/OpenRA.Utility/Program.cs index 4bdb92bed3..0f1b0631a9 100644 --- a/OpenRA.Utility/Program.cs +++ b/OpenRA.Utility/Program.cs @@ -45,7 +45,12 @@ namespace OpenRA Game.InitializeSettings(Arguments.Empty); - var modSearchPaths = new[] { Path.Combine(".", "mods"), Path.Combine("^", "mods") }; + var envModSearchPaths = Environment.GetEnvironmentVariable("MOD_SEARCH_PATHS"); + var modSearchPaths = (!string.IsNullOrWhiteSpace(envModSearchPaths) ? envModSearchPaths.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries) + : new[] { Path.Combine(".", "mods"), Path.Combine("^", "mods") }) + .Select(path => path.Trim()) + .ToArray(); + if (args.Length == 0) { PrintUsage(new InstalledMods(modSearchPaths, new string[0]), null);