Crates.io | cargocleaner |
lib.rs | cargocleaner |
version | 0.9.6 |
source | src |
created_at | 2019-09-25 23:23:42.148697 |
updated_at | 2019-12-08 02:56:32.03103 |
description | Runs cargo clean on all subdirectories |
homepage | https://crates.io/crates/cargocleaner |
repository | https://github.com/cfsamson/tools-cargocleaner |
max_upload_size | |
id | 167659 |
size | 7,863 |
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.
cargo install cargocleaner
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.
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.
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.