sebnilsson - dotnet-cleanup 0.5.1

.NET Core Global Tool for cleaning up solution, project or folder

PM> Install-Package dotnet-cleanup -Version 0.5.1 -Source https://www.myget.org/F/sebnilsson/api/v3/index.json

Copy to clipboard

> nuget.exe install dotnet-cleanup -Version 0.5.1 -Source https://www.myget.org/F/sebnilsson/api/v3/index.json

Copy to clipboard

> dotnet tool install -g dotnet-cleanup --version 0.5.1 --add-source https://www.myget.org/F/sebnilsson/api/v3/index.json

Copy to clipboard
<DotNetCliToolReference Include="dotnet-cleanup" Version="0.5.1" />
Copy to clipboard
source https://www.myget.org/F/sebnilsson/api/v3/index.json

nuget dotnet-cleanup  ~> 0.5.1
Copy to clipboard

> choco install dotnet-cleanup --version 0.5.1 --source https://www.myget.org/F/sebnilsson/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "sebnilsson" -SourceLocation "https://www.myget.org/F/sebnilsson/api/v2"
Install-Module -Name "dotnet-cleanup" -RequiredVersion "0.5.1" -Repository "sebnilsson" 
Copy to clipboard

dotnet-cleanup

.NET tool for cleaning generated folders from a directory tree.

By default, it targets the common output/dependency folders **/bin, **/obj and **/node_modules.

To maximize the speed of deletion, enabling instant working with your project, the tool moves the deleted files to a temp-folder first, before deleting.

Install

Requires .NET SDK: https://dotnet.microsoft.com/download

Install the .NET tool:

dotnet tool install --global dotnet-cleanup

Usage

USAGE:
    dotnet-cleanup [PATH] [OPTIONS]

EXAMPLES:
    dotnet-cleanup c:\src\project --include **/bin --include **/obj --include **/node_modules --exclude README.md
    dotnet-cleanup -p **/bin -p **/obj -y
    dotnet-cleanup -p **/node_modules --verbosity minimal

ARGUMENTS:
    [PATH]    The starting path for the cleanup. Defaults to current directory

OPTIONS:
    -h, --help                  Prints help information
    -p, --include <PATTERNS>    Glob paths to include in cleanup. Default paths: **/bin, **/obj, **/node_modules
    -x, --exclude <PATTERNS>    Glob paths to exclude from cleanup
    -y, --yes                   Run cleanup skipping confirm prompt
        --noop                  No-op mode: list matching paths without moving or deleting anything. Equivalent to
                                --no-move and --no-delete
        --no-delete             Skip deleting matched paths after moving them to temporary folder. Ignored when --noop
                                is used
        --no-move               Skip moving matched paths to temporary folder before deletion. Ignored when --noop is
                                used
        --temp-path <PATH>      Temporary path to move cleanup files before deletion
    -v, --verbosity <LEVEL>     Sets the verbosity level. Allowed values are minimal (m), normal (n) and detailed (d)

Examples

# Clean current directory tree (confirmation prompt enabled)
dotnet-cleanup

# Clean a specific folder tree
dotnet-cleanup C:\src\project

# Custom include/exclude patterns
dotnet-cleanup -p "**/bin" -p "**/obj" -p "**/node_modules" -x "**/samples/**"

# Skip confirmation
dotnet-cleanup -y

# List only (do not move or delete)
dotnet-cleanup --noop

# Move to temp folder, but do not delete
dotnet-cleanup --no-delete -y

# Delete in place without temp staging
dotnet-cleanup --no-move -y

Behavior

  • Start path defaults to your current working directory.
  • Default include patterns are **/bin, **/obj, and **/node_modules.
  • Include/exclude patterns are matched relative to the chosen start path.
  • Exclude patterns take precedence over include patterns.
  • By default, matched paths are moved to a temp staging folder before deletion, then the temp staging folder for the run is removed.
  • --no-delete keeps moved paths in temp staging and skips deletion.
  • --noop lists matching paths but skips both move and delete.
  • Temp staging defaults to the system temp path; override with --temp-path.
  • Temp path is only checked when move before delete is enabled (default).
  • Verbosity levels: minimal, normal, detailed.
  • Normal verbosity prints completion summaries. When confirmation is enabled, matching paths are listed before the prompt.
  • Detailed verbosity also prints step headings and matching paths.
  • .NETCoreApp 2.1
  • .NETCoreApp 2.1: 2.1.0.0

Owners

sebnilsson

Authors

Sebastian Nilsson

Project URL

https://github.com/sebnilsson/DotnetCleanup

License

MIT

Info

625 total downloads
121 downloads for version 0.5.1
Download (158.4 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
0.6.0 147.2 KB Thu, 18 Jul 2019 10:05:56 GMT 127
0.5.5 147.2 KB Thu, 18 Jul 2019 09:43:35 GMT 130
0.5.2 158.39 KB Tue, 23 Oct 2018 09:28:26 GMT 123
0.5.1 158.4 KB Mon, 22 Oct 2018 06:16:28 GMT 121
0.5.0 157.49 KB Wed, 17 Oct 2018 11:23:13 GMT 124