-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support lerna execution from subdirectories of repo root #687
Conversation
…TopLevelDirectory
…kages() signature
This PR is based on #664. Many thanks @noherczeg! |
let stdout = child.execSync(command, mergedOpts); | ||
if (stdout) { | ||
// stdout is undefined when stdio[1] is anything other than "pipe" | ||
// and there's no point trimming an empty string (no piped stdout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I encountered this issue when I ignored stderr
in GitUtilities.isInitialized()
. That was a fun debugging session.
@@ -83,8 +96,8 @@ export default class Command { | |||
} | |||
|
|||
runValidations() { | |||
if (this.concurrency < 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out that this block could never be entered because of the way we currently interpret the sort
option.
return this.lernaJson && this.lernaJson.version; | ||
} | ||
|
||
get publishConfig() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The publishConfig
and bootstrapConfig
properties are already handled by Command.getOptions()
, so it seemed safe to remove these.
const deps = pkg[depsKey]; | ||
const {exact} = this.getOptions(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was bugging me that we were calling this every time, even if there were no deps.
@@ -83,8 +96,8 @@ export default class Command { | |||
} | |||
|
|||
runValidations() { | |||
if (this.concurrency < 1) { | |||
this.logger.warn("command must be run with at least one thread."); | |||
if (!GitUtilities.isInitialized()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @evocateur,
Just testing the upgrade path from v1-beta.36 to v2-rc.4 and come across this check. We noticed it as it started breaking on CI where it copies a previously cloned repo to another area to perform more tasks (rather than cloning again).
I'm sure we can change our build setup easy enough - but I was just wondering what the reason is as to why Lerna needs to be executed in a git repo or if this check could be dropped?
Thanks for your help
We recently (last week) eased this restriction to only affect commands that actually need git (publish, diff, etc). It doesn't solve it for rc4, but I hope to release it soon.
… On May 8, 2017, at 01:49, Peter Mouland ***@***.***> wrote:
@peter-mouland commented on this pull request.
In src/Command.js:
> @@ -83,8 +96,8 @@ export default class Command {
}
runValidations() {
- if (this.concurrency < 1) {
- this.logger.warn("command must be run with at least one thread.");
+ if (!GitUtilities.isInitialized()) {
Hi @evocateur,
Just testing the upgrade path from v1-beta.36 to v2-rc.4 and come across this check. We noticed it as it started breaking on CI where it copies a previously cloned repo to another area to perform more tasks (rather than cloning again).
I'm sure we can change our build setup easy enough - but I was just wondering what the reason is as to why Lerna needs to be executed in a git repo or if this check could be dropped?
Thanks for your help
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
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. |
A few high-level goals, here:
lerna init
should be the only time we (maybe) rungit init
.lerna
commands should ensure they are run in a git repo during the validation phase, not instantiation.fixes #645, #555