Skip to content
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

fix(core): more detailed error message when version cannot be found #431

Merged
merged 1 commit into from Dec 23, 2022

Conversation

ghiscoding
Copy link
Member

@ghiscoding ghiscoding commented Dec 23, 2022

Description

As per Lerna PR 3424

When running a lerna command and no version is present in lerna.json configuration following error message is printed:

lerna ERR! ENOLERNA `lerna.json` does not exist, have you run `lerna init`?

As described in (lerna/lerna#3311) this is not completely correct.

Additional check is added during command validation to prove a version is available in lerna.json file. In addition the check for having a lerna configuration (lerna.json) available is adapted to really check for existance of the config file. This is achieved by setting an additional flag configNotFound in the project object during lerna.json retrival.

Motivation and Context

Improve error messages for invalid lerna.json to support user finding configuration problems. The issue is described here (lerna/lerna#3311).

How Has This Been Tested?

Added a unit test. Manually built a lerna version.

Types of changes

  • Chore (change that has absolutely no effect on users)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@ghiscoding ghiscoding merged commit 7f3dffb into main Dec 23, 2022
@ghiscoding ghiscoding deleted the bugfix/improve-error-messages branch December 23, 2022 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant