CuginiTech.GZip
1.0.3
dotnet tool install --global CuginiTech.GZip --version 1.0.3
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo dotnet tool install --local CuginiTech.GZip --version 1.0.3
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=CuginiTech.GZip&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package CuginiTech.GZip --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CuginiTech Gzip
A small tool to allow a csproj file to gzip source files into a destination folder.
Usage
dotnet gzip --source <file-or-wildcard-pattern> [--destination <some-folder>] [--overwrite]
If just source is provided then the generated file will appear along side the source with .gz appended.
- --source (-s) <file> Source file or wildcard pattern (required).
- --destination (-d) <folder> Optional folder to write to. Will attemt to create if missing.
- --overwrite (-o) Flag when set then source file will always overwrite destination. Normally if a destination file is found it is skipped.
- --recurse (-r) Scan sub folders for pattern too. Destination files will appear in sub folders in destination matching folders found in source.
Examples
Compress files alongside source
dotnet gzip --source *.txt
All matched txt files will be saved as *.txt.gz alongside the source files.
Compress files into another folder
dotnet gzip --source *.txt --destination .\zipped
Compress files every time
dotnet gzip --source *.txt --destination .\zipped --overwrite
Normally if a compressed file is found then it will be skipped. Overwrite will always try and replace the compressed file. Useful for changing source files.
Recurse folders
dotnet gzip --source *.js --destination .\zipped --recurse
Given a source tree with files
├── a.js
│ ├── controller
│ │ ├── b.js
│ ├── views
│ │ ├── c.js
│ ├── model
│ ├── css
You'll get the following in the destination folder zipped
├── zipped
│ ├── a.js.gz
│ │ ├── controller
│ │ │ ├── b.js.gz
│ │ ├── views
│ │ │ ├── c.js.gz
Note folders that don't find a match won't be created.
Installation
Global
dotnet tool install --global CuginiTech.GZip
Local
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local CuginiTech.GZip
Update
dotnet tool update CuginiTech.GZip
Changes
1.0.3 [2023-09-30]
- Allow source and destination to be quoted either with a single or a double quote.
- Fixed a bug where flags were incorrectly matching portions of paths.
1.0.2 [2023-09-29]
- Small fix so that it does not return an error when there are no files to compress.
1.0.1 [2023-09-29]
- Added recursion.
1.0.0 [2023-09-22]
- Initial release.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.