You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you're in a Rust project directory (somewhere with a valid Cargo.toml), calling cargo clean --target-dir /some/path will delete everything in /some/path, whether it's a Cargo target directory or not.
I think it would make sense to add some checks to cargo clean --target-dir, to make sure it doesn't unintentionally remove more than the user would like it to.
A few ideas:
We could look for some distinctive flag files in a target directory, and refuse to remove it if we don't find them.
We could create a flag file and look for that. (This may cause transition issues, though, if people upgrade and then clean before building with the new cargo.)
We could only remove subdirectories we know about, and if that doesn't leave the target directory empty, avoid removing everything else.
BartMassey, ssokolow, weihanglo, lainisourgod and tks3141