markdown-prune

Crates.iomarkdown-prune
lib.rsmarkdown-prune
version0.0.8
sourcesrc
created_at2024-01-06 11:30:30.606267
updated_at2024-06-06 23:55:35.381798
descriptionUtility for deleting all markdown files in a folder recursively
homepagehttps://github.com/hougesen/markdown-prune
repositoryhttps://github.com/hougesen/markdown-prune
max_upload_size
id1090864
size19,851
Mads Hougesen (hougesen)

documentation

README

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.

Commit count: 68

cargo fmt