https://github.com/hougesen/markdown-prune
Tool for deleting unwanted files by extension to reduce container size
https://github.com/hougesen/markdown-prune
cli command-line docker filesystem markdown rust terminal tool
Last synced: 4 months ago
JSON representation
Tool for deleting unwanted files by extension to reduce container size
- Host: GitHub
- URL: https://github.com/hougesen/markdown-prune
- Owner: hougesen
- License: mit
- Created: 2022-08-14T13:58:22.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-06-06T23:53:37.000Z (about 2 years ago)
- Last Synced: 2025-10-11T20:03:49.699Z (9 months ago)
- Topics: cli, command-line, docker, filesystem, markdown, rust, terminal, tool
- Language: Rust
- Homepage:
- Size: 53.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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
```sh
cargo install markdown-prune
```
## Usage
### Basic usage
Providing a path to a folder is required.
```sh
# 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.
```sh
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.
```sh
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`.
```sh
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`
```sh
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.