Skip to content

Commit

Permalink
chore(docs): update filter options docs to specify quote necessity (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
fahslaj committed Jan 13, 2023
1 parent a5217c6 commit fcab26a
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions core/filter-options/README.md
Expand Up @@ -12,20 +12,31 @@ Include only packages with names matching the given glob.

```sh
$ lerna exec --scope my-component -- ls -la
$ lerna run --scope toolbar-* test
$ lerna run --scope package-1 --scope *-2 lint
$ lerna run --scope "toolbar-*" test
$ lerna run --scope package-1 --scope "*-2" lint
```

**Note:** For certain globs, it may be necessary to quote the option argument to avoid premature shell expansion.

### **Running with `npx`**

When running `lerna` with `npx`, it is necessary to use an explicit "=" when passing glob arguments. This is to prevent `npx` from prematurely expanding the arguments.

For example:

```sh
$ npx lerna run --scope="toolbar-*" test
$ npx lerna run --scope="package-{1,2,5}" test
```

### `--ignore <glob>`

Exclude packages with names matching the given glob.

```sh
$ lerna exec --ignore package-{1,2,5} -- ls -la
$ lerna run --ignore package-1 test
$ lerna run --ignore package-@(1|2) --ignore package-3 lint
$ lerna exec --ignore "package-{1,2,5}" -- ls -la
$ lerna run --ignore package-1 test
$ lerna run --ignore "package-@(1|2)" --ignore package-3 lint
```

More examples of filtering can be found [here](https://github.com/lerna/lerna/blob/c0a750e0f482c16dda2f922f235861283efbe94d/commands/list/__tests__/list-command.test.js#L305-L356).
Expand Down

0 comments on commit fcab26a

Please sign in to comment.