Skip to content

Commit

Permalink
Fix compiler compression bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
FirehawkV21 committed Sep 15, 2022
1 parent 8611491 commit b53ac58
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions RMMVCookTool.CLI/CompilerEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,14 @@ public void ProcessCommandLineArguments(in string[] args)
//Else, either just compress or compress and delete the files.
else
{
CompilerUtilities.RecordToLog($"The project will be compressed after compiling.", 0);
if (setupTool.CompressProject == 2)
if (newProject.Setup.RemoveSourceFiles)
{
CompilerUtilities.RecordToLog($"The project will be compressed after compiling.", 0);
newProject.Setup.CompressProjectFiles = true;
if (argnum + 1 <= args.Length - 1)
{
setupTool.CompressProject = args[argnum + 1] == "Final" ? 1 : 2;
newProject.Setup.RemoveFilesAfterCompression = setupTool.CompressProject == 1;
argsTable.AddRow(Resources.CompressionEntry, ((argnum + 1 <= args.Length - 1) && args[argnum + 1] == "Final") ? Resources.CompressAndRemoveEntry : Resources.CompressOnlyEntry);
Console.ForegroundColor = ConsoleColor.DarkGreen;
Console.WriteLine((argnum + 1 <= args.Length - 1) && args[argnum + 1] == "Final" ?
Expand Down Expand Up @@ -145,7 +147,6 @@ public void ProcessCommandLineArguments(in string[] args)

//This command line argument deletes the JavaScript files after compiling.
case "--ReleaseMode":
setupTool.CompressProject = 2;
CompilerUtilities.RecordToLog($"JS files will be removed.", 0);
newProject.Setup.RemoveSourceFiles = true;
Console.ResetColor();
Expand Down Expand Up @@ -294,7 +295,7 @@ public void StartWorker()
Console.WriteLine(Resources.NwjsStartingTestNotificationText);
newProject.RunTest(setupTool.SdkLocation);
}
else if (setupTool.CompressProject is < 3 and 2)
else if (setupTool.CompressProject is < 3)
{
CompilerUtilities.RecordToLog(Resources.PackagingGameText, 0);
timer.Start();
Expand Down Expand Up @@ -332,8 +333,5 @@ public void StartWorker()
}
}

public void StartSetup()
{
setupTool.SetupWorkload(newProject);
}
public void StartSetup() => setupTool.SetupWorkload(newProject);
}

0 comments on commit b53ac58

Please sign in to comment.