Skip to content

Commit

Permalink
Fixed copy step
Browse files Browse the repository at this point in the history
Fixes #142
  • Loading branch information
Exactol committed Feb 12, 2021
1 parent b96731f commit afbb000
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions CompilePalX/Compilers/CompileExecutable.cs
Expand Up @@ -39,18 +39,21 @@ public override void Run(CompileContext c)
}

var args = GameConfigurationManager.SubstituteValues(GetParameterString(), c.MapFile);
var filename = GameConfigurationManager.SubstituteValues(Metadata.Path);
if (!File.Exists(filename.Replace("\"", "")))
{
CompilePalLogger.LogCompileError($"Failed to find executable: {filename}\n", new Error("Failed to find executable: {filename}", ErrorSeverity.FatalError));
return;
}

Process.StartInfo.FileName = filename;
Process.StartInfo.FileName = GameConfigurationManager.SubstituteValues(Metadata.Path);;
Process.StartInfo.Arguments = string.Join(" ", args);
Process.StartInfo.WorkingDirectory = runningDirectory;

Process.Start();
try
{
Process.Start();
}
catch (Exception e)
{
CompilePalLogger.LogDebug(e.ToString());
CompilePalLogger.LogCompileError($"Failed to run executable: {Process.StartInfo.FileName}\n", new Error($"Failed to run executable: {Process.StartInfo.FileName}", ErrorSeverity.FatalError));
return;
}
Process.PriorityClass = ProcessPriorityClass.BelowNormal;

if (Metadata.ReadOutput)
Expand Down

0 comments on commit afbb000

Please sign in to comment.