Skip to content

steveelon9/cacheelon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

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 and env doesn't exist anymore, or -f is provided.

  • The cached version of env is older than 1 day since the command was run and env doesn't exist anymore, or -f is provided.

    $ 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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published