rmdev

Crates.iormdev
lib.rsrmdev
version0.2.4
sourcesrc
created_at2024-07-20 16:57:21.067873
updated_at2024-07-22 02:47:14.010455
descriptionThis is a tool to delete the remaining dependencies and cache files in the development environment, eg: nodule_modules、target...
homepagehttps://github.com/WumaCoder/rmdev.git
repositoryhttps://github.com/WumaCoder/rmdev.git
max_upload_size
id1309626
size239,004
Lyda (Lydanne)

documentation

README

Rmdev

中文

Hello

This is a tool to delete the remaining dependencies and cache files in the development environment, eg: nodule_modules、target...

Feature

  • 🌟 batch deletion
  • 🚀 fast deletion
  • 🧹 support multi project type
    • nodejs (nodule_modules)
    • rust (target)
    • ...

Install

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh # install cargo

cargo install rmdev

Use

rmdev clear ../ -f

# ../ clear target dir

Help

rmdev clear --help

Skip Scan

Add rmdev.skip file to your project. skip to deletion.

Contribute

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.

About

MIT

Commit count: 0

cargo fmt