2019.6.8 • Published 5 years ago
mkcache v2019.6.8
make cache file. inspired by 'mktemp'
Installation
$ [sudo] npm i -g mkcache
How it works
$XDG_CACHE_HOME/mkcache/<hash>
Config
export MKCACHE=path/to/cache # ~/.cache/mkcache by default
Scripts usage
command | usage |
---|---|
mkcache | usage: mkcache args ... |
Examples
example 1. speed up macOS tts with mkcache:
path="$(mkcache "$@")"
! [ -e "$path" ] && /usr/bin/say "$@" -o "$path"
afplay "$path"
example 2. execute script once:
path="$(mkcache script "$@")"
! [ -e "$path" ] && { script "$@" || exit; touch "$path"; }