diff --git a/.goreleaser.yml b/.goreleaser.yml index dce8092..0aa2c09 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -10,8 +10,10 @@ before: builds: - main: ./main.go binary: sttr - goos: ["linux", "darwin", "windows"] + goos: ["linux", "darwin", "windows", "freebsd"] goarch: ["386", "amd64", "arm64"] + flags: + - -trimpath ldflags: - -s -w -X "main.version={{.Version}}" env: @@ -64,6 +66,7 @@ nfpms: formats: - deb - rpm + - archlinux - termux.deb bindir: /usr/bin @@ -77,7 +80,6 @@ snapcrafts: confinement: strict license: MIT base: core20 - apps: sttr: plugs: ["home", "network"] @@ -201,7 +203,16 @@ docker_signs: - --yes archives: - - id: default + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives format_overrides: - goos: windows format: zip @@ -218,7 +229,7 @@ winget: homepage: https://github.com/abhimanyu003/sttr license_url: https://github.com/abhimanyu003/sttr/blob/master/LICENSE copyright: Copyright (c) 2021-{{ .Now.Format "2006" }} Abhimanyu Sharma - release_notes: '{{ .Changelog }}' + release_notes: "{{ .Changelog }}" release_notes_url: https://github.com/abhimanyu003/sttr/releases/tag/{{ .Tag }} tags: - cli @@ -234,10 +245,10 @@ winget: owner: abhimanyu003 name: winget-pkgs branch: sttr-{{ .Version }} - token: '{{ .Env.GITHUB_TOKEN }}' + token: "{{ .Env.GITHUB_TOKEN }}" pull_request: enabled: true base: owner: microsoft name: winget-pkgs - branch: master \ No newline at end of file + branch: master diff --git a/ui/ui.go b/ui/ui.go index a50720b..81701c7 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -2,10 +2,11 @@ package ui import ( "fmt" - "golang.org/x/term" "log" "os" + "golang.org/x/term" + "github.com/abhimanyu003/sttr/processors" "github.com/abhimanyu003/sttr/utils" @@ -40,12 +41,12 @@ func (u *UI) Render() { termWidth = maxWidth } if u.input == "" { - divider := lipgloss.NewStyle().Padding(0, 1).Foreground(borderStyle).Render("•") + divider := lipgloss.NewStyle().Margin(0, 1).Foreground(borderStyle).Render("•") info := lipgloss.NewStyle().Foreground(specialStyle).Render("[ Enter 2 empty lines to process ]") title := lipgloss.NewStyle(). MaxWidth(termWidth). - BorderStyle(lipgloss.DoubleBorder()). + BorderStyle(lipgloss.NormalBorder()). BorderTop(true). BorderBottom(true). BorderForeground(borderStyle). @@ -58,7 +59,7 @@ func (u *UI) Render() { u.list = list.New(processors.List, list.NewDefaultDelegate(), 0, 0) u.list.Title = "Select transformation" - if _, err := tea.NewProgram(u).Run(); err != nil { + if _, err := tea.NewProgram(u, tea.WithAltScreen()).Run(); err != nil { log.Fatalf("error running ui: %v", err) } @@ -71,7 +72,7 @@ func (u *UI) Render() { border := lipgloss.NewStyle(). Width(termWidth). BorderTop(true). - BorderStyle(lipgloss.DoubleBorder()). + BorderStyle(lipgloss.NormalBorder()). BorderForeground(borderStyle).String() fmt.Println(border) @@ -88,7 +89,7 @@ func (u *UI) View() string { return "" } - return appStyle.Margin(1, 1).Render(u.list.View()) + return appStyle.Render(u.list.View()) } func (u *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {