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

[FEATURE] Prefer local over global CLI version #59

Merged
merged 5 commits into from
Nov 15, 2018
Merged

Conversation

matz3
Copy link
Member

@matz3 matz3 commented Oct 1, 2018

When running the global "ui5" command while a local @ui5/cli version is
installed for the current project, the local one should be preferred.

Fixes: #58

@matz3 matz3 requested a review from RandomByte October 1, 2018 18:49
@CLAassistant
Copy link

CLAassistant commented Oct 1, 2018

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coveralls
Copy link

coveralls commented Oct 1, 2018

Pull Request Test Coverage Report for Build 310

  • 12 of 19 (63.16%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.07%) to 41.245%

Changes Missing Coverage Covered Lines Changed/Added Lines %
bin/ui5.js 12 19 63.16%
Totals Coverage Status
Change from base Build 300: 0.07%
Covered Lines: 79
Relevant Lines: 185

💛 - Coveralls

@RandomByte
Copy link
Member

rebased

@RandomByte
Copy link
Member

Is "Prefer local over global CLI version" really a fix or rather a feature? I would opt for the latter

@matz3
Copy link
Member Author

matz3 commented Oct 16, 2018

Yes, I think feature is a better fit.

When running the global "ui5" command while a local @ui5/cli version is
installed for the current project, the local one should be preferred.

Fixes: #58
@RandomByte RandomByte changed the title [FIX] Prefer local over global CLI version [FEATURE] Prefer local over global CLI version Oct 16, 2018
RandomByte
RandomByte previously approved these changes Oct 16, 2018
Copy link
Member

@RandomByte RandomByte left a comment

Choose a reason for hiding this comment

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

Ok from my side.

@matz3 please confirm that the change in commit bc59b85 is fine for you

@matz3
Copy link
Member Author

matz3 commented Oct 16, 2018

@RandomByte good idea. This also helps to see whether a locally linked ui5-cli project is used.
I also like the README explanation 👍

But the ENV var is strange. I would expect to have a general "UI5 CLI" prefix that could be used in future for more variables, like UI5CLI_* or UI5_CLI_*.
And a shorter one... what about UI5_CLI_NO_LOCAL=true?
This would also fit the a command option that can be used in "XO" for the same matter, which is something to think about:
https://github.com/xojs/xo/blob/d1fd3e127b191b701716d6f775b6f5c8c5db3778/cli.js#L10

About the console.info logs. I think we shouldn't always log this. Especially not in such a verbose way. XO and AVA just use the debug module. I would only expect them with --verbose or DEBUG=*.

@RandomByte RandomByte added the enhancement New feature or request label Oct 18, 2018
@RandomByte
Copy link
Member

Done

Copy link
Member Author

@matz3 matz3 left a comment

Choose a reason for hiding this comment

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

Nice 👍 Seems that you need to approve as I'm the author.

Copy link
Member

@RandomByte RandomByte left a comment

Choose a reason for hiding this comment

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

Forgot to update the README with the new environment variable name. Seems to be all good now. Yours to merge.

@RandomByte
Copy link
Member

Note (just came to my mind): When using a CLI release containing this change in a repository that uses a release without it, no INFO: Using local @ui5/cli installation information will be logged due to the missing setTimeout in older bin/ui5.js versions.

@matz3
Copy link
Member Author

matz3 commented Nov 15, 2018

Yes, that's correct, but I think this can be neglected.

@matz3 matz3 merged commit 3c2a0a8 into master Nov 15, 2018
@matz3 matz3 deleted the prefer-local branch November 15, 2018 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants