Skip to content

Commit

Permalink
Merge pull request #2276 from TheCakeIsNaOH/mono-truncate
Browse files Browse the repository at this point in the history
(#2076) Pack always truncate stream
  • Loading branch information
gep13 authored Sep 22, 2021
2 parents f6d6140 + 59efd51 commit 30a4ae0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/chocolatey/infrastructure.app/nuget/NugetPack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ public static IPackage BuildPackage(PackageBuilder builder, IFileSystem fileSyst
{
using (Stream stream = fileSystem.create_file(outputPath))
{
// Truncate if needed, as Mono fails to truncate
if (stream.Length > 0)
{
stream.SetLength(0);
}
builder.Save(stream);
}
}
Expand Down

0 comments on commit 30a4ae0

Please sign in to comment.