Fix PATH env var expanding in Flax.Build app runner

This commit is contained in:
Wojtek Figat
2022-03-22 19:03:13 +01:00
parent bb2f8f34dc
commit 532203040f

View File

@@ -355,14 +355,14 @@ namespace Flax.Build
Stopwatch stopwatch = Stopwatch.StartNew(); Stopwatch stopwatch = Stopwatch.StartNew();
if (!options.HasFlag(RunOptions.NoLoggingOfRunCommand)) if (!options.HasFlag(RunOptions.NoLoggingOfRunCommand))
{ {
Log.Verbose("Running: " + app + " " + (string.IsNullOrEmpty(commandLine) ? "" : commandLine)); Log.Verbose("Running: " + app + (string.IsNullOrEmpty(commandLine) ? "" : " " + commandLine));
} }
bool redirectStdOut = (options & RunOptions.NoStdOutRedirect) != RunOptions.NoStdOutRedirect; bool redirectStdOut = (options & RunOptions.NoStdOutRedirect) != RunOptions.NoStdOutRedirect;
Process proc = new Process(); Process proc = new Process();
proc.StartInfo.FileName = app; proc.StartInfo.FileName = app;
proc.StartInfo.Arguments = string.IsNullOrEmpty(commandLine) ? "" : commandLine; proc.StartInfo.Arguments = commandLine != null ? commandLine : "";
proc.StartInfo.UseShellExecute = false; proc.StartInfo.UseShellExecute = false;
proc.StartInfo.RedirectStandardInput = input != null; proc.StartInfo.RedirectStandardInput = input != null;
proc.StartInfo.CreateNoWindow = true; proc.StartInfo.CreateNoWindow = true;
@@ -386,7 +386,7 @@ namespace Flax.Build
{ {
if (env.Key == "PATH") if (env.Key == "PATH")
{ {
proc.StartInfo.EnvironmentVariables[env.Key] = proc.StartInfo.EnvironmentVariables[env.Key] + ';' + env.Value; proc.StartInfo.EnvironmentVariables[env.Key] = env.Value + ';' + proc.StartInfo.EnvironmentVariables[env.Key];
} }
else else
{ {