Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
santisq committed Jan 15, 2025
1 parent 5675106 commit bac3a41
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
4 changes: 1 addition & 3 deletions src/PSCompression/Commands/CompressZipArchiveCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ protected override void BeginProcessing()
| WildcardOptions.CultureInvariant
| WildcardOptions.IgnoreCase;

_excludePatterns = Exclude
.Select(pattern => new WildcardPattern(pattern, options))
.ToArray();
_excludePatterns = [.. Exclude.Select(pattern => new WildcardPattern(pattern, options))];
}
}

Expand Down
8 changes: 2 additions & 6 deletions src/PSCompression/Commands/GetZipEntryCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,12 @@ protected override void BeginProcessing()

if (Exclude is not null)
{
_excludePatterns = Exclude
.Select(e => new WildcardPattern(e, options))
.ToArray();
_excludePatterns = [.. Exclude.Select(e => new WildcardPattern(e, options))];
}

if (Include is not null)
{
_includePatterns = Include
.Select(e => new WildcardPattern(e, options))
.ToArray();
_includePatterns = [.. Include.Select(e => new WildcardPattern(e, options))];
}
}

Expand Down
7 changes: 3 additions & 4 deletions src/PSCompression/Commands/NewZipEntryCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public sealed class NewZipEntryCommand : PSCmdlet, IDisposable
public string[]? EntryPath
{
get => _entryPath;
set => _entryPath = value.Select(e => e.NormalizePath()).ToArray();
set => _entryPath = [.. value.Select(e => e.NormalizePath())];
}

[Parameter]
Expand Down Expand Up @@ -160,10 +160,9 @@ protected override void ProcessRecord()

try
{
_writers ??= _entries
_writers ??= [.. _entries
.Where(e => !string.IsNullOrEmpty(e.Name))
.Select(e => new ZipContentWriter(_zip, e, Encoding))
.ToArray();
.Select(e => new ZipContentWriter(_zip, e, Encoding))];

foreach (ZipContentWriter writer in _writers)
{
Expand Down

0 comments on commit bac3a41

Please sign in to comment.