mirror of
https://github.com/charmbracelet/glow
synced 2024-11-10 06:04:18 +00:00
More logging around keygen
This commit is contained in:
parent
b94615f5ac
commit
555462462f
1 changed files with 12 additions and 0 deletions
12
ui/ui.go
12
ui/ui.go
|
@ -294,6 +294,9 @@ func update(msg tea.Msg, mdl tea.Model) (tea.Model, tea.Cmd) {
|
|||
} else {
|
||||
// The keygen ran but things still didn't work and we can't auth
|
||||
m.stash.err = errors.New("SSH authentication failed; we tried ssh-agent, loading keys from disk, and generating SSH keys")
|
||||
if debug {
|
||||
log.Println(m.stash.err)
|
||||
}
|
||||
|
||||
// Even though it failed, news/stash loading is finished
|
||||
m.stash.loaded |= loadedStash | loadedNews
|
||||
|
@ -303,6 +306,9 @@ func update(msg tea.Msg, mdl tea.Model) (tea.Model, tea.Cmd) {
|
|||
case keygenFailedMsg:
|
||||
// Keygen failed. That sucks.
|
||||
m.stash.err = errors.New("could not authenticate; could not generate SSH keys")
|
||||
if debug {
|
||||
log.Println(m.stash.err)
|
||||
}
|
||||
m.keygenState = keygenFinished
|
||||
|
||||
// Even though it failed, news/stash loading is finished
|
||||
|
@ -515,6 +521,9 @@ func loadNews(m stashModel) tea.Cmd {
|
|||
}
|
||||
|
||||
func generateSSHKeys() tea.Msg {
|
||||
if debug {
|
||||
log.Println("running keygen...")
|
||||
}
|
||||
_, err := keygen.NewSSHKeyPair(nil)
|
||||
if err != nil {
|
||||
if debug {
|
||||
|
@ -522,6 +531,9 @@ func generateSSHKeys() tea.Msg {
|
|||
}
|
||||
return keygenFailedMsg{err}
|
||||
}
|
||||
if debug {
|
||||
log.Println("keys generated succcessfully")
|
||||
}
|
||||
return keygenSuccessMsg{}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue