Crates.io | rmdev |
lib.rs | rmdev |
version | 0.2.4 |
source | src |
created_at | 2024-07-20 16:57:21.067873 |
updated_at | 2024-07-22 02:47:14.010455 |
description | This is a tool to delete the remaining dependencies and cache files in the development environment, eg: nodule_modules、target... |
homepage | https://github.com/WumaCoder/rmdev.git |
repository | https://github.com/WumaCoder/rmdev.git |
max_upload_size | |
id | 1309626 |
size | 239,004 |
This is a tool to delete the remaining dependencies and cache files in the development environment, eg: nodule_modules、target...
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # install cargo
cargo install rmdev
rmdev clear ../ -f
# ../ clear target dir
rmdev clear --help
Add rmdev.skip
file to your project. skip to deletion.
I hope that this tool will eventually cover all the major languages, but more of this work needs to be contributed by all of you ❤️!
We can contribute by modifying the src/scan_category.rs
file and writing in the PR what tool in what language generated the.
use std::path::Path;
use once_cell::sync::Lazy;
pub(crate) static STRATEGY: Lazy<Vec<ScanCate>> =
Lazy::new(|| vec![ScanCate::Npm, ScanCate::Cargo]);
#[derive(Debug, Clone)]
pub enum ScanCate {
Npm,
Cargo,
}
impl ScanCate {
pub(crate) fn access_keyfile(&self, path: &Path) -> bool {
match self {
Self::Npm => path.join("package.json").exists(),
Self::Cargo => path.join("Cargo.toml").exists(),
}
}
pub(crate) fn rm_keyfile(&self, path: &Path) -> bool {
match self {
Self::Npm => path.to_str().unwrap().contains("node_modules"),
Self::Cargo => path.to_str().unwrap().contains("target"),
}
}
pub(crate) fn ident(&self) -> String {
match self {
Self::Npm => "NPM",
Self::Cargo => "Cargo",
}
.to_string()
}
}
The whole process is still very easy, everyone is welcome to contribute.
MIT