Skip to content

Feature/lerna exec#151

Closed
joscha wants to merge 3 commits intolerna:masterfrom
joscha:feature/lerna-exec
Closed

Feature/lerna exec#151
joscha wants to merge 3 commits intolerna:masterfrom
joscha:feature/lerna-exec

Conversation

@joscha
Copy link
Copy Markdown
Contributor

@joscha joscha commented May 19, 2016

This implements a proper lerna exec command that allows you to both pass flags to the lerna runtime and run commands in each package with multiple parameters, e.g.:
lerna exec --debug -- ls -la node_modules

closes #130

cc @thejameskyle
Also, after this is merged I'd like to enhance #145 to also change the target packages of lerna exec.

eirslett and others added 3 commits May 19, 2016 17:07
As opposed to 'lerna run', which runs
scripts defined in package.json, exec will
let you execute an inbuilt npm command directly
in each package, e.g.

- `lerna exec rebuild`
- `lerna exec publish`
- `lerna exec upgrade`
It should run any command, not just
an npm command.
@joscha joscha mentioned this pull request May 19, 2016
@@ -1,4 +1,5 @@
import child from "child_process";
import objectAssign from "object-assign";
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it possible to use Object.assign directly? (I'm not sure whether babel polyfills it or not, to be honest)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it depends on the runtime - object-assign was available already, so I just used it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't using Babel polyfill or Babel runtime atm so no but we could

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need it to support older versions of node too

@eirslett
Copy link
Copy Markdown

Where is the logic that handles everything before -- as flags to lerna, and everything after as the actual command?

@joscha
Copy link
Copy Markdown
Contributor Author

joscha commented May 19, 2016

@eirslett it seems to be handled by meow automatically. Everything before the -- lands in .flags.

@jpnelson
Copy link
Copy Markdown
Contributor

This will also fix #150

@joscha
Copy link
Copy Markdown
Contributor Author

joscha commented May 20, 2016

#152 should be favored to this one.

@jamiebuilds
Copy link
Copy Markdown
Contributor

Moving to #152

@lock
Copy link
Copy Markdown

lock Bot commented Dec 28, 2018

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.

@lock lock Bot locked as resolved and limited conversation to collaborators Dec 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants