holmgr / cargo-sweep

A cargo subcommand for cleaning up unused build files generated by Cargo
MIT License
693 stars 31 forks source link

Add option to clean all release or all debug build artifacts #76

Open taladar opened 1 year ago

taladar commented 1 year ago

This would allow cleaning of e.g. a project you mostly work with productively but you compile it in debug mode occasionally to fix some bugs or add small features.

The opposite mode would allow cleaning the occasional release build to e.g. benchmark in a project you mostly just develop in debug mode.

jyn514 commented 1 year ago

I like that idea, thanks! Don't have time to write up full mentoring instructions, but the basic idea is to only recurse into the (e.g.) target/debug directory, which happens at a pretty high level and shouldn't need a detailed knowledge of how cargo works.

Logarithmus commented 1 year ago

https://doc.rust-lang.org/cargo/commands/cargo-clean.html

I guess cargo clean --release or --profile dev is exactly what you need.