-
Notifications
You must be signed in to change notification settings - Fork 16
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
Move closehandler to pkg, move feedback form to closehandler #72
Conversation
@@ -29,8 +29,6 @@ var rootCmd = &cobra.Command{ | |||
func init() { | |||
cobra.OnInitialize(initLogger) | |||
|
|||
displayOptions.FeedbackFormURL = "https://forms.gle/K9ga7FZB3deaffnV7" |
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.
Would that be possible to leave it here and pass displayOptions to closehandler?
internal/app/loophole/loophole.go
Outdated
func ForwardPort(config lm.ExposeHttpConfig) { | ||
setupCloseHandler(config.Display.FeedbackFormURL) | ||
closehandler.SetupCloseHandler() |
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.
what if you would set it up in the commands only? E.g. in each relevant Run
method, or even PreRun
? I think it should then not duplicate the output and should be enough to fix ctrl c breaking temrinal
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 don't remember why I thought that it needs to be setup in every command separately, after some testing I just moved it to the init of the root command and it worked for both ssh and basic auth.
} | ||
|
||
//SuccessfulConnectionOccured sets the corresponding boolean to true, enabling the display of the feedback form URL after closing the CLI | ||
func SuccessfulConnectionOccured() { |
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.
maybe MarkConnectionSuccessful
instead?
dac5642
to
9052e3d
Compare
Closes #71
There is still a bug where several instances of "Goodbye" will be printed at the end because a separate closehandler seems to be needed for every pkg inside of which the user might press CTRL+C; a way of closing the closehandler without closing the program is the next step