Skip to content
/ rmdev Public

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

License

Notifications You must be signed in to change notification settings

Lydanne/rmdev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages