Server: Get mod search paths from env MOD_SEARCH_PATHS

This commit is contained in:
Taryn Hill
2017-03-12 19:11:41 -05:00
parent d095ccf668
commit 4d5f9e0de7
2 changed files with 9 additions and 5 deletions

View File

@@ -46,10 +46,9 @@ namespace OpenRA
Game.InitializeSettings(Arguments.Empty);
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();
var modSearchPaths = !string.IsNullOrWhiteSpace(envModSearchPaths) ?
FieldLoader.GetValue<string[]>("MOD_SEARCH_PATHS", envModSearchPaths) :
new[] { Path.Combine(".", "mods"), Path.Combine("^", "mods") };
if (args.Length == 0)
{