Closed treshugart closed 6 years ago
The inconsistency between scoped ls
/bootstrap
and run
is certainly itchy. I am open to making it more consistent.
This was fixed waaaay back in v2.0.0 🤸♀️
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I'm implementing #822 and have been attempting to integrate it into our workflow. However, I'm running into some issues where I want to scope some commands using that flag (
--since
) but don't want it to error if no packages are run.In thinking about this, I'm not sure it's valuable to ever exit with non-zero if no scoped packages are matched; it doesn't seem like an exceptional state. Warning might be fine, but even then, it's fairly clear when no packages are matched.
Expected Behavior
I would expect to be able to run
lerna run something --scope some-unmatched-package
without errors.This is also inconsistent with how scoping is applied to built-in Lerna commands as well as
exec
. For example,bootstrap
andls
don't error if a filtering option doesn't match any packages, it just logs that it didn't run in any packages.Current Behavior
The command errors. This means you can't do something like
lerna run eslint --since this-branch
to only lint against changed files, it will fail linting if no packages have been changed.To work around this you can do something like
lerna exec --since ref -- eslint
.Possible Solution
The built-in commands log how many packages a command was run in, so maybe we can follow suit here for
run
.Steps to Reproduce (for bugs)
n/a
Context
This seems only an issue for
lerna run
, so to work around it you could useexec
, but it feels odd to have to do something likelerna exec --scope package -- npm run test
.Your Environment
n/a