asimov
asimov copied to clipboard
Add options to exclude other directories
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...
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:
- A matching directory name is used in a non-development context (e.g. a directory full of vendor-provided PDFs named
vendor/
) - 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 - A node project might have
build/
as a directory for builds, but another type of project might usebuild
for the CLI scripts to create the builds.
Also, tagging #6 here so I remember to write this down 😉
@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
So this would ignore any directory which has a plain .tmignore
file in it?
. ./.tmignore
'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.