Code Monkey home page Code Monkey logo

time-warp's Introduction

time-warp tests

TIME WARP

A MacOS Time Machine Tinkerer

Ever wish Time Machine for MacOS didn't back-up all of your composer, npm or git submodule dependencies?

Intro

Time Warp monitors your filesystem for dependency directories and excludes those found from Time Machine backups.

What

At its heart Time Warp is a cli that can be used to set up a watch on chosen filesystem paths for changes to defined target files or directories, excluding from Time Machine backups those that are identified.

Targets are defined by configurable (and extendable) profiles, and the profiles are then used both to filter paths for the watch process and to positively identify newly created paths as targets for exclusion.

File Profiles

File profiles – located by default in ~/.config/time-warp/profiles – are used to dynamically identify filesystem paths as a target to be excluded from backups.

Additional profiles can be added to the default directory which, following a restart of any running watch process, will extend Time Warp's monitoring to other files.

A file profile is made up of filters and predicates.

Filters

Time Warp uses watchexec under the hood for filesystem monitoring and profile filters are essentially a proxy for setting certain watchexec filter options. Allowed options are:

  • -e, --exts=[extensions]
    • Comma-separated list of file extensions to filter by. Leading dots (.rs) are allowed. (This is a shorthand for -f).
  • -f, --filter=[pattern]
    • Ignores modifications from paths that do not match pattern. This option can be specified multiple times, where a match on any given pattern causes the path to trigger command.
  • -i, --ignore=[pattern]
    • Ignores modifications from paths that match pattern. This option can be specified multiple times, and a match on any pattern causes the path to be ignored.

Both the short- and long-form options are allowed and the equal sign joining an option handle to its value is required.

Valid:

--filter=**/pattern/**

Invalid:

--filter **/pattern/**

Predicates

Predicates are used to test that a candidate matched by the watcher – as defined by the profile filters – definitively matches this profile. Predicates are tested sequentially, in the order in which they are defined, and they must all evaluate as true in order to identify a candidate path as a confirmed target.

Predicate values are essentially relative path values, tested for existence or non-existence. Allowed predicate tests are currently any combination of:

  • -d, --directory=[path/2/dir/that/should/exist]
  • -f, --file=[path/2/file/that/should/exist]

A predicate can also be negated with an exclamation mark, as follows:

  • --file!=[file/that/should/not/exist]

time-warp's People

Contributors

tomchkk avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.