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
Skip git repo check by default in Commands which do not rely on git #803
Skip git repo check by default in Commands which do not rely on git #803
Conversation
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.
Basically, this isn't really something that needs to be configurable by users; a command either requires git or it doesn't. I think we can get more clarity (and keep the CLI less noisy) with an opt-out subclass getter method override.
src/Command.js
Outdated
@@ -175,7 +175,7 @@ export default class Command { | |||
} | |||
|
|||
runValidations() { | |||
if (!GitUtilities.isInitialized(this.execOpts)) { | |||
if (!this.options.skipGitCheck && !GitUtilities.isInitialized(this.execOpts)) { |
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'd rather this was some sort of class property optionally overridden (kinda like the otherCommandConfigs()
getter) when a command requires git. The base class has get requiresGit() { return true; }
, and various commands that don't need git can opt-out by overriding the getter method.
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'll update the PR in the evening. Thanks for the feedback!
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.
Awesome, thanks @noherczeg!
Hey @noherczeg , thanks for revisiting this.
Or it's supposed to be available in |
Yep, this has not been released yet. |
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. |
According to Bootstrap Command's description it is not necessarily true that we need to check if the command was run in a project where there is a pre-initialized git repository. This PR tries to resolve this issue.
Description
I added a
--skip-git-check
flag to the Bootstrap Command which is on by default resulting in a behavior described aboveMotivation and Context
#438
How Has This Been Tested?
I added integration tests.
Types of changes
Checklist: