#hash #cache #filename #web #busting #command-line-tool #cli

app cache_bust_cli

CLI tool for use in conjunction with the cache_bust crate to add hashes to file names

2 unstable releases

0.2.0 May 29, 2024
0.1.0 May 23, 2024

#246 in Caching

49 downloads per month

MIT license

29KB
287 lines

cache_bust_cli

This is a CLI-tool to be used in combination with cache_bust to add hashes to file names.

Installation

Using cargo:

cargo install cache_bust_cli --locked

Using nix:

nix shell github:dav-wolff/cache_bust#cli

Usage

Rename all files in a directory in-place:

cachebust assets

Copy all files in a directory to a new directory with hashes added:

cachebust assets --out hashed_assets

Rename a single file in-place and print its new name or hash:

cachebust assets --file image.png --print file-name # image.d0a2[...].png
cachebust assets --file image.png --print hash # d0a2[...]

Copy a single file to a new directory with its hash added and print its new path:

cachebust assets --file image.png --print file-path # /path/to/image.d0a2[...].png

Dependencies

~1.6–8.5MB
~78K SLoC