GithubHelp home page GithubHelp logo

hougesen / markdown-prune Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 55 KB

Tool for deleting unwanted files by extension to reduce container size

License: MIT License

Rust 100.00%
markdown cli rust tool command-line docker filesystem terminal

markdown-prune's Introduction

markdown-prune

Utility for deleting all markdown files in a folder recursively. Intended to be used as part of a CI/CD pipeline to reduce container size.

Installation

cargo install markdown-prune

Usage

Basic usage

Providing a path to a folder is required.

# Current path
markdown-prune .

# Absolute path
markdown-prune /path/to/folder

# Relative path
markdown-prune ./node_modules

Explicit arguments

Path

--path is used to pass an explicit path.

markdown-prune --path ./node_modules
# Deleted 2185 files totaling 12.03mb

Dry running

If you want to dry run first before deleting the files, either pass --dry or --check as an argument. Dry running only works with an explicit path argument.

markdown-prune --path ./node_modules --check
# Found 2185 files totaling 12.03mb

Custom filenames & extensions

If you wish to remove files you can use the following commands --file, --file-name or --ext.

markdown-prune --path ./node_modules --file .DS_Store --file .d.ts

# Found 25216 files totaling 114.10MB

Result unit size

The argument --unit can be used to change the default result byte size.

It accepts the following b, kb, mb, gb, tb

markdown-prune --path ./node_modules --check --unit b
# Found 2185 files totaling 12030000b

markdown-prune --path ./node_modules --check --unit kb
# Found 2185 files totaling 12030kb

markdown-prune --path ./node_modules --check --unit mb
# Found 2185 files totaling 12.03mb

markdown-prune --path ./node_modules --check --unit gb
# Found 2185 files totaling 0.01gb

markdown-prune --path ./node_modules --check --unit tb
# Found 2185 files totaling 0tb

Disclaimer

Use at your own risk.

markdown-prune's People

Contributors

hougesen avatar

Stargazers

 avatar  avatar

Watchers

 avatar

markdown-prune's Issues

ignore file

ignore file and/or arg for passing file for extensions to delete, kinda file eslint --ignore-path

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.