Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options to exclude other directories #28

Open
muuvmuuv opened this issue Oct 9, 2018 · 4 comments
Open

Add options to exclude other directories #28

muuvmuuv opened this issue Oct 9, 2018 · 4 comments

Comments

@muuvmuuv
Copy link

muuvmuuv commented Oct 9, 2018

As a developer, I often have compiled folders in my project and I would like to exclude them as well from TimeMaschine. e.g.:

  • build: (from web projects compiled from webpack)
  • cache, __pycache__: (some shit programs create for caching)
  • tmp: (temporary files that the program needs but can easily be recreated)
  • and much more, depending on your workflow...
@stevegrunwell
Copy link
Owner

Asimov is always down for additional Time Machine exclusions!

Right now, the list is defined as $FILEPATHS:

readonly FILEPATHS=(
    "vendor ../composer.json"
    "node_modules ../package.json"
    ".vagrant ../Vagrantfile"
    "bower_components ../bower.json"
)

The trick is making sure that excluded files have the matching configuration file that defines how that dependency should be built. For example, a node_modules/ directory will only be excluded from Time Machine if there's a package.json file one directory above.

The whole "only exclude a dependency if we have a matching config" is to prevent cases such as:

  1. A matching directory name is used in a non-development context (e.g. a directory full of vendor-provided PDFs named vendor/)
  2. A code repository includes third-party code as part of the distribution (rather than relying on a tool like Composer), so it explicitly includes a vendor/ directory
  3. A node project might have build/ as a directory for builds, but another type of project might use build for the CLI scripts to create the builds.

Also, tagging #6 here so I remember to write this down 😉

@muuvmuuv
Copy link
Author

@stevegrunwell so something like this would be awesome "build ../webpack.*.js" or a .asimovignore in a project and in there folders to be excluded?
Also related to #27

@webdeb
Copy link

webdeb commented Mar 2, 2019

So this would ignore any directory which has a plain .tmignore file in it?

. ./.tmignore

@ideasculptor
Copy link

'The trick is to make sure there is a matching config file' is a pretty weak solution, since in many cases, there is no such config file to list. Additionally, asimov won't even accept a directory as a config 'file', when directories are clearly as likely to be a trigger a file is.

We need an option for a second list of filenames which get matched, regardless of the presence of a trigger file. A directory named 'build' which is chock full of object files, libraries, and linked binaries is an utterly common occurrence, and there is no way to detect it unless there happens to be some file with a common name sitting in a parent directory - which is pretty much never the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants