npm-run-all icon indicating copy to clipboard operation
npm-run-all copied to clipboard

Ability to exclude a particular task

Open quantizor opened this issue 5 years ago • 2 comments

It'd be nice for run-s etc. to be able to exclude a particular script via argument in the case of temporarily needing to suppress something.

e.g.

run-s test:* --except test:foo

quantizor avatar Jun 03 '19 00:06 quantizor

It uses minimatch under the hood, so you can already use negated patterns.

In your case:

run-s test:!(foo)

Demo:

❯ run-s 'wow:*'

> @ wow:a
> echo a

a

> @ wow:b
> echo b

b

> @ wow:c
> echo c

c
❯ run-s 'wow:!(c)'

> @ wow:a
> echo a

a

> @ wow:b
> echo b

b

You can even exclude multiple:

❯ run-s 'wow:!(b|c)'

> @ wow:a
> echo a

a

fregante avatar Jun 07 '19 15:06 fregante

@fregante this doesn't work as expected. When you e.g. try to exclude "b" in a series of a, b, c. It also doesn't execute "c".

webholics avatar Nov 05 '20 08:11 webholics