IndigoUnited / automaton

Task automation tool built in JavaScript
http://indigounited.com/automaton
MIT License
214 stars 10 forks source link

Improve exclusion of files in minimatch #46

Open marcooliveira opened 11 years ago

marcooliveira commented 11 years ago

Excluding files from a minimatch expression can be tricky, and the syntax can become a nightmare to read. Maybe we should come up with a simpler syntax?

If we take the cp example, we could support something like this:

files: {
  'src/**/*.js,!*.min.js': 'dst'
}

This would copy all the .js files, except those that end with .min.js, the exclamation mark being a negation (exclusion) operator, and the comma separating these. This expression could be composed of several comma separated expressions and, in order for a file to match, it would have to match ALL the expressions.

These sort of features should be provided in something like ctx.file, so that task creators don't have to do this by hand repetitively, and also it should be part of the automaton-lib. Check #45 for more information on this.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/98439-improve-exclusion-of-files-in-minimatch?utm_campaign=plugin&utm_content=tracker%2F39683&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F39683&utm_medium=issues&utm_source=github).
marcooliveira commented 11 years ago

Check https://github.com/mklabs/node-fileset for ideas.

marcooliveira commented 11 years ago

Big breakthrough for this issue in https://github.com/IndigoUnited/automaton/issues/50#issuecomment-12926218. This will be the base for improving exclusions.