Skip to content

Commit

Permalink
fix for CLIv1/Extension bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ctacke committed Dec 24, 2024
1 parent 10639bd commit 96c5944
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,22 @@ async Task AddFile(string file, bool includePdbs)
var crc = CrcTools.Crc32part(bytes, len, 0); // 0x04C11DB7);

Logger.LogDebug("{file} crc is {crc:X8}", file, crc);
files.Add(file, crc);
if (files.ContainsKey(file))
{
// file already exists in our list?
// this feels like a bug, but for now we'll see if it has the same CRC
if (crc != files[file])
{
throw new Exception($"To differing (by CRC) versions of file '{file}' exist in the build output");
}

// same file CRC, just ignore the new call to add it
}
else
{
files.Add(file, crc);
}

if (includePdbs)
{
var pdbFile = Path.ChangeExtension(file, "pdb");
Expand Down

0 comments on commit 96c5944

Please sign in to comment.