mach icon indicating copy to clipboard operation
mach copied to clipboard

Add support for dynamically matching targets

Open SevereOverfl0w opened this issue 8 years ago • 1 comments

There is a basis protocol (Target) which exposes match? for whether or not a target matches. A sequential search is then performed over all targets for each input target.

Example usage of this feature:

;; Machfile.edn
{#mach/glob "*.md" {product "somefile"
		    produce (str "# A title")}}

$ mach hello.md
Writing somefile

Further functionality that is necessary to make this feature useful is the exposure of the match ctx (already assoced onto the target when it matches) so that code can refer to the full path. To extend the example above, the future feature should allow the product to be set based on the matching input.

I haven't thoroughly tested this, so a second pair of eyes over this would be good.

SevereOverfl0w avatar May 19 '17 16:05 SevereOverfl0w

new commit added which dynamically binds vars relative to the match context.

SevereOverfl0w avatar May 27 '17 15:05 SevereOverfl0w