Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#2379) Correct pack files filter for Linux #2380

Merged
merged 1 commit into from
Sep 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/chocolatey/infrastructure.app/nuget/NugetPack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ namespace chocolatey.infrastructure.app.nuget
using System.Linq;
using NuGet;
using IFileSystem = filesystem.IFileSystem;
using chocolatey.infrastructure.platforms;

// ReSharper disable InconsistentNaming

Expand Down Expand Up @@ -61,8 +62,9 @@ private static void ExcludeFiles(ICollection<IPackageFile> packageFiles)
// Always exclude the nuspec file
// Review: This exclusion should be done by the package builder because it knows which file would collide with the auto-generated
// manifest file.
var filter = Platform.get_platform() == PlatformType.Windows ? @"**\*" : "**/*";
var excludes = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
var wildCards = excludes.Concat(new[] {@"**\*" + Constants.ManifestExtension, @"**\*" + Constants.PackageExtension});
var wildCards = excludes.Concat(new[] { filter + Constants.ManifestExtension, filter + Constants.PackageExtension });

PathResolver.FilterPackageFiles(packageFiles, ResolvePath, wildCards);
}
Expand Down