fornwall / rust-script

Run Rust files and expressions as scripts without any setup or compilation step.
https://rust-script.org
Apache License 2.0
1.27k stars 43 forks source link

Option to purge orphaned packages and artifacts #125

Open gokuldas opened 11 months ago

gokuldas commented 11 months ago

There currently doesn't seem to be any option to remove the packages and other artifacts from the cache, for just the scripts that don't exist anymore. The only available option is --clear-cache, which clears the entire cache, including those of the scripts that are still live.

Rationale: If you move a script from one location to another and execute it, rust-script creates a new package in the cache and leaves the old one orphaned. A user may wish to clear just the orphaned package and artifacts without losing all the useful objects in the cache.

Suggestion: Add a --gc option to do this.

Thank you!