https://github.com/andrewpetrochenkov/mkcache
make cache file. inspired by 'mktemp'
https://github.com/andrewpetrochenkov/mkcache
cli
Last synced: 3 months ago
JSON representation
make cache file. inspired by 'mktemp'
- Host: GitHub
- URL: https://github.com/andrewpetrochenkov/mkcache
- Owner: andrewpetrochenkov
- License: unlicense
- Created: 2019-06-03T19:06:26.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-03T21:10:29.000Z (over 4 years ago)
- Last Synced: 2024-06-14T10:08:52.647Z (about 1 year ago)
- Topics: cli
- Language: Shell
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[]()
[](https://pypi.org/project/mkcache/)
[](https://www.npmjs.com/package/mkcache)[](https://unlicense.org/)
[](https://github.com/andrewp-as-is/mkcache/actions)### Installation
```bash
$ [sudo] pip install mkcache
``````bash
$ [sudo] npm i -g mkcache
```#### How it works
```
$XDG_CACHE_HOME/mkcache/
```#### Config
```bash
export MKCACHE=path/to/cache # ~/.cache/mkcache by default
```#### Examples
example 1. run script only once:
```bash
path="$(mkcache script "$@")"
! [ -e "$path" ] && { script "$@" || exit; touch "$path"; }
```example 2. speed up macOS tts with mkcache:
```bash
path="$(mkcache "$@")"
! [ -e "$path" ] && /usr/bin/say "$@" -o "$path"
afplay "$path"
```