Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lydanne/rmdev
This is a tool to delete the remaining dependencies and cache files in the development environment, eg: nodule_modules、target...
https://github.com/lydanne/rmdev
cli rust tools tui
Last synced: 6 days ago
JSON representation
This is a tool to delete the remaining dependencies and cache files in the development environment, eg: nodule_modules、target...
- Host: GitHub
- URL: https://github.com/lydanne/rmdev
- Owner: Lydanne
- License: mit
- Created: 2024-07-20T16:12:00.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2024-07-22T02:46:27.000Z (4 months ago)
- Last Synced: 2024-10-06T09:23:54.287Z (about 1 month ago)
- Topics: cli, rust, tools, tui
- Language: Rust
- Homepage:
- Size: 248 KB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme-zh.md
- License: LICENSE
Awesome Lists containing this project
README
Rmdev
## 开始
这是一个工具,用于删除开发环境中的剩余依赖项和缓存文件,例如:node_modules、target 等。
## 特性
- 🌟 批量删除
- 🚀 快速删除
- 🗑 支持多类型项目工程
- nodejs (node_modules)
- rust (target)
- ...## 安装
```shell
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # 安装 cargocargo install rmdev
```## 使用
```shell
rmdev clear ../ -f# ../ 清除 target 目录
```## 帮助
```shell
rmdev clear --help
```## 跳过扫描
在你的项目中添加 `rmdev.skip` 文件即可跳过删除。
## 贡献
我希望这个工具最终能覆盖所有主要语言,但更多的工作需要大家的贡献 ❤️!
我们可以通过修改 `src/scan_category.rs` 文件来贡献,并在 PR 中说明是什么语言生成的什么工具。
```rs
use std::path::Path;use once_cell::sync::Lazy;
pub(crate) static STRATEGY: Lazy> =
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()
}
}
```整个过程非常简单,欢迎大家贡献。
## 关于
MIT