Coder Social home page Coder Social logo

ocy's Introduction

ocy – Project Cleaner

A simple, temporary build files cleaning CLI app written in Rust.

Colophon

Ocy is short for Ocypode cordimanus, or smooth-handed ghost crab. Like all crabs of the genus Ocypode, it has one claw larger than the other (as on the banner).

Although he's so cute, ocy is a scavenger – he will take care of your dead bytes.

BBayCrab2

Installation

cargo install ocy

Motivation

I use to play a lot with several languages/techs and would regularily end up with GBs used by temporary build outputs on my litte Macbook Pro SSD.

Each build/project system have its own convention for storing temporary build files (i.e Cargo will use target, gradle will use build, etc. …) and I wanted to have a quick tool for wiping them securely.

  • Why not an existing tool?

    Most of cleanup/wipe tools I found seem to focus on handling up one single type of project.

  • Why not bash?

    Clever use of bash/find can give you 80% of what ocy is doing. However, if we want a little bit of security, for instance matching folders by the build pattern may have a lot of false positive, and ergonomics, such as displaying and summing-up folder size, something more involved is required.

  • Why Rust?

    It is fun to write a CLI app in Rust! And in the end the executable will be quite small (currently around 3.2MB without too much time spent into optimizing it). Any language could have done the job here. So this is for fun and learning.

Supported Rules

Ocy is based on the idea of rules for detecting projects. In the current form a pattern is given for detecting the project, and another pattern for files and folders to delete.

Rule name Project matcher Files to delete
Cargo Cargo.toml target
Gradle build.gradle build
GradleKTS build.gradle.kts build
Flutter pubspec.yaml build
Maven pom.xml target
NodeJS * node_modules
XCode * DerivedData
SBT build.sbt target
SBT plugins.sbt target

Usage

Usage: ocy [OPTIONS]

Optional arguments:
  -h, --help             print help message
  -i, --ignores IGNORES  ignore this path
  -v, --version          print version
  -a, --all              walk into hidden dirs

Future Plans

  • Make a TUI; since the ‘UI’ is decoupled from the cleaning logic (ocy-core) it should be easy to support both CLI and TUI.

  • Add user customizable rules, and support more projects resp. more complex rule definition.

ocy's People

Contributors

virtualritz avatar alexd6631 avatar ilaborie avatar

Stargazers

Max Đ.  avatar dbr/Ben avatar Shravan Asati avatar Renan Decamps avatar Alexander Czernay avatar Pradeep Chauhan avatar Guillaume Dumoulin avatar Hao Wu avatar  avatar Lubomir Anastasov avatar Yoann Fleury avatar Andréy Lesnikóv avatar  avatar

Watchers

James Cloos avatar  avatar  avatar

ocy's Issues

CMake support

Would you consider adding support for cleaning up CMake builds?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.