Skip to content

Commit ca966a4

Browse files
authored
Ensure that the cached version of MCC is refreshed every update (#2760)
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.
1 parent c50b360 commit ca966a4

File tree

1 file changed

+9
-1
lines changed
  • MinecraftClient/Scripting/DynamicRun/Builder

1 file changed

+9
-1
lines changed

MinecraftClient/Scripting/DynamicRun/Builder/Compiler.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,15 @@ private static CSharpCompilation GenerateCode(string sourceCode, string fileName
9494
{
9595
if (file.EndsWith("mcc-executable"))
9696
{
97-
useExisting = true;
97+
// Check if the file is the same as the current executable.
98+
if (File.ReadAllBytes(file).SequenceEqual(File.ReadAllBytes(executablePath)))
99+
{
100+
useExisting = true;
101+
break;
102+
}
103+
104+
// If not, refresh the cache.
105+
File.Delete(file);
98106
break;
99107
}
100108
}

0 commit comments

Comments
 (0)