{{ message }}
Avoid exiting with error when trying to install the same dep twice#4536
Closed
giopetris wants to merge 1 commit into
Closed
Avoid exiting with error when trying to install the same dep twice#4536giopetris wants to merge 1 commit into
giopetris wants to merge 1 commit into
Conversation
samcoe
suggested changes
Oct 18, 2021
Contributor
There was a problem hiding this comment.
@giopetris Thanks for the contribution. While this code works I think it would be simpler to keep the logic of checkValidExtension the same but return a new error type such as AlreadyInstalledError in the case where the extension is already installed. That way the code at extension/command.go:108 just needs to handle that specific error case and providing the user a warning like
if opts.IO.IsStdoutTTY() {
fmt.Fprintf(opts.IO.ErrOut, "%s Extension %s is already installed\n", cs.WarningIcon(), extName)
}
return nilDoes that make sense? Let me know if you have questions about that direction.
Contributor
|
@giopetris Do you plan on continuing work on this PR? If not I will close it to allow other community members to work on the issue. |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #4463
Before if you ran
gh extension install <some-dep>twice, on the second attempt it was exiting with the error code 1, now it just prints the error message but terminates the program successfully (code 0).