tcache
v0.1.7
Published
A directory tree caching command line tool
Downloads
3
Readme
tcache
tcache is a command line tool for caching directory trees or files. An example usecase would be a build/continuous integration system where on each build application dependencies need to be setup consuming considerable time and quite often depending on the network or external repositories being available and not banning users for abuse.
Example use case
In the following example, the command pip install -r requirements.txt
will be executed only
if one of the following conditions is true:
It is the first time you run the command, thus the env directory doesn't exist yet
The contents of requirements.txt have changed since the last time the command was run
The cached version of env is older than 1 daythe command was run
$ tcache -p env -k $(md5 -q requirements.txt) -r 1d -- pip install -r requirements.txt --root=env
Here is a similar example, but for npm:
$ tcache -p ./node_modules -k $(md5 -q package.json) -- npm install
By default cached directory trees are stored in $HOME/.tcache, this can be changed with the -c option.
Please, run tcache --help
for further details and usage examples.