https://github.com/cfsamson/tools-cargocleaner
Tool that walks through all directories from the base and runs "cargo clean" on all Cargo projects
https://github.com/cfsamson/tools-cargocleaner
Last synced: 3 months ago
JSON representation
Tool that walks through all directories from the base and runs "cargo clean" on all Cargo projects
- Host: GitHub
- URL: https://github.com/cfsamson/tools-cargocleaner
- Owner: cfsamson
- License: mit
- Created: 2019-09-25T22:46:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-08T03:02:13.000Z (over 5 years ago)
- Last Synced: 2025-02-28T05:56:26.388Z (4 months ago)
- Language: Rust
- Size: 1.52 MB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Cargo clean for all subdirectories
`cargocleaner` simply walks all subdirectories from the current path it's called
from and if it finds a `Cargo.toml` document it runs the command `cargo clean`.It's the same as if you manually went through each folder and ran `cargo clean`
manually.This can save huge amounts of space if you have many projects. One one of my
folders it went from 20 GB to 800 MB.
## Install
### Cargo install
`cargo install cargocleaner`
To update the program
`cargo install --force cargocleaner`
### Manually
Clone this repository.
Run `cargo install --path ./`.You should now be able to simply call `./cargocleaner` in a directory that
contains one or more Cargo projects and let it run.## Limitations
Right now this is just a very simple tool but since we don't go through sub folders
if we find a `Cargo.toml` in the root. This should work fine with `workspaces` but
if for some reason you have a file called `Cargo.toml` which is not in the root of
a crate it might not continue down any subdirectories.## Tip
This program will invoke commands on your system. `cargo clean` does delete files,
but there is no logic in this code can delete anything besides what `cargo clean`
does. The source is very short so look through it before running it on your system
if you're in doubt.