https://github.com/xt0rted/dotnet-rimraf
Deep deletion command for .NET (like rm -rf)
https://github.com/xt0rted/dotnet-rimraf
build-tool dotnet dotnet-tool dotnet-tools rimraf rm-rf
Last synced: 10 months ago
JSON representation
Deep deletion command for .NET (like rm -rf)
- Host: GitHub
- URL: https://github.com/xt0rted/dotnet-rimraf
- Owner: xt0rted
- License: mit
- Created: 2022-03-25T04:48:58.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-12T12:06:47.000Z (about 1 year ago)
- Last Synced: 2025-03-17T22:06:37.724Z (about 1 year ago)
- Topics: build-tool, dotnet, dotnet-tool, dotnet-tools, rimraf, rm-rf
- Language: C#
- Homepage:
- Size: 450 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
#
dotnet-rimraf
[](https://github.com/xt0rted/dotnet-rimraf/actions/workflows/ci.yml)
[](https://www.nuget.org/packages/rimraf)
[](https://nuget.pkg.github.com/xt0rted/index.json)
[](LICENSE)
Deep deletion command for .NET (like rm -rf).
This is based on the [node tool](https://github.com/isaacs/rimraf) of the same name.
## Installation
This tool can be used as a dotnet global tool, or a dotnet local tool.
If using it as part of a build script it's recommended to install it as a local tool.
### Global
```console
dotnet tool install rimraf --global
```
### Local
```console
dotnet new tool-manifest
dotnet tool install rimraf
```
## Keeping current
Tools like [Dependabot](https://github.com/apps/dependabot) (https://github.com/github/feedback/discussions/13825) and [Renovate](https://github.com/marketplace/renovate) don't currently support updating dotnet local tools.
One way to automate this is to use a [GitHub Actions workflow](https://github.com/xt0rted/dotnet-tool-update-test) to check for updates and create PRs when new versions are available, which is what this repo does.
## Options
Name | Description
-- | --
`--dry-run` | See what would be deleted (enables `--verbose`)
`--no-preserve-root` | Delete the directory being acted on instead of preserving it
`--verbose` | Enable verbose output
`--version` | Show version information
`--help` | Show help and usage information
## Usage
Use `dotnet rimraf` (`rimraf` if using as a global tool) to delete files and directories.
You can pass one or more paths or globs to delete.
Globbing is handled by the [`DotNet.Glob`](https://github.com/dazinator/DotNet.Glob) library and supports of all its patterns and wildcards.
```console
rimraf artifacts coverage
```
```console
rimraf artifacts/**/*-pre*.nupkg
```
```console
rimraf **/bin **/obj
```
### Working directory
The working directory is the directory that `rimraf` is run from.
## Development
This project uses the [run-script](https://github.com/xt0rted/dotnet-run-script) dotnet tool to manage its build and test scripts.
To use this you'll need to run `dotnet tool install` and then `dotnet r` to see the available commands or look at the `scripts` section in the [global.json](global.json).