Skip to content

Commit

Permalink
fix: exit when get release failed
Browse files Browse the repository at this point in the history
  • Loading branch information
beetcb committed Feb 11, 2022
1 parent c98b896 commit b18c035
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cmd/ghdl.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ gh-dl handles archived or compressed file as well`,
ghRelease := ghdl.GHRelease{RepoPath: repo, TagName: tag}
ghReleaseDl, err := ghRelease.GetGHReleases()
if err != nil {
h.Print(fmt.Sprintf("get gh releases failed: %s\n", err), h.PrintModeErr)
h.Print(fmt.Sprintf("get gh releases failed: %s", err), h.PrintModeErr)
os.Exit(1)
}

if binaryNameFlag != "" {
Expand Down
4 changes: 2 additions & 2 deletions helper/sl/sl.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (m model) View() string {
colorS := paddingS.Copy().
Foreground(blue).BorderLeft(true).BorderForeground(blue)
if m.selected == -1 {
s := paddingS.Copy().Foreground(yellow).Render("gh-dl can't figure out which release to download\nplease select it manully") + "\n"
s := "\n" + paddingS.Copy().Foreground(yellow).Render("gh-dl can't figure out which release to download\nplease select it manully") + "\n\n"
for i, choice := range m.choices {
if m.cursor == i {
s += colorS.Render(choice) + "\n"
Expand All @@ -68,7 +68,7 @@ func (m model) View() string {
// Send the UI for rendering
return s + "\n"
} else {
s := paddingS.Copy().Foreground(yellow).Render(fmt.Sprintf("start downloading %s", lipgloss.NewStyle().Foreground(blue).Render(m.choices[m.selected]))) + "\n"
s := "\n" + paddingS.Copy().Foreground(yellow).Render(fmt.Sprintf("start downloading %s", lipgloss.NewStyle().Foreground(blue).Render(m.choices[m.selected]))) + "\n"
return s
}
}
Expand Down

0 comments on commit b18c035

Please sign in to comment.