Skip to content

Commit

Permalink
Ensure that the cached version of MCC is refreshed every update (#2760)
Browse files Browse the repository at this point in the history
fixes #2758

this happened because we added sentry in a future release, but the cache was using an old executable, so it couldn't find the assembly.
  • Loading branch information
breadbyte authored Jul 13, 2024
1 parent c50b360 commit ca966a4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion MinecraftClient/Scripting/DynamicRun/Builder/Compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,15 @@ private static CSharpCompilation GenerateCode(string sourceCode, string fileName
{
if (file.EndsWith("mcc-executable"))
{
useExisting = true;
// Check if the file is the same as the current executable.
if (File.ReadAllBytes(file).SequenceEqual(File.ReadAllBytes(executablePath)))
{
useExisting = true;
break;
}

// If not, refresh the cache.
File.Delete(file);
break;
}
}
Expand Down

0 comments on commit ca966a4

Please sign in to comment.