Skip to content

Commit

Permalink
move UI under main executable dir
Browse files Browse the repository at this point in the history
  • Loading branch information
rusq committed Apr 10, 2024
1 parent b663c0c commit f6b24d0
Show file tree
Hide file tree
Showing 19 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/slackdump/internal/apiconfig/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"

"github.com/rusq/slackdump/v3/cmd/slackdump/internal/golang/base"
"github.com/rusq/slackdump/v3/internal/ui"
"github.com/rusq/slackdump/v3/cmd/slackdump/internal/ui"
)

var CmdConfigCheck = &base.Command{
Expand Down
2 changes: 1 addition & 1 deletion cmd/slackdump/internal/apiconfig/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (

"github.com/rusq/slackdump/v3/cmd/slackdump/internal/cfg"
"github.com/rusq/slackdump/v3/cmd/slackdump/internal/golang/base"
"github.com/rusq/slackdump/v3/cmd/slackdump/internal/ui"
"github.com/rusq/slackdump/v3/internal/network"
"github.com/rusq/slackdump/v3/internal/ui"
)

var CmdConfigNew = &base.Command{
Expand Down
2 changes: 1 addition & 1 deletion cmd/slackdump/internal/diag/uninstall.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/rusq/slackdump/v3/cmd/slackdump/internal/cfg"
"github.com/rusq/slackdump/v3/cmd/slackdump/internal/diag/info"
"github.com/rusq/slackdump/v3/cmd/slackdump/internal/golang/base"
"github.com/rusq/slackdump/v3/internal/ui"
"github.com/rusq/slackdump/v3/cmd/slackdump/internal/ui"
"github.com/rusq/slackdump/v3/logger"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/slackdump/internal/emoji/wizard.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/rusq/slackdump/v3/cmd/slackdump/internal/cfg"
"github.com/rusq/slackdump/v3/cmd/slackdump/internal/golang/base"
"github.com/rusq/slackdump/v3/internal/ui"
"github.com/rusq/slackdump/v3/cmd/slackdump/internal/ui"
)

func wizard(ctx context.Context, cmd *base.Command, args []string) error {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"strings"

"github.com/rusq/slackdump/v3/cmd/slackdump/internal/ui"
"github.com/rusq/slackdump/v3/internal/structures"
"github.com/rusq/slackdump/v3/internal/ui"
)

// ConversationList asks the user for the list of conversations to dump or
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"time"

"github.com/rusq/slackdump/v3/internal/ui"
"github.com/rusq/slackdump/v3/cmd/slackdump/internal/ui"
)

func MaybeTimeRange() (oldest, latest time.Time, err error) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 7 additions & 2 deletions cmd/slackdump/internal/wizard/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import (
)

type model struct {
form *huh.Form
val string
form *huh.Form
val string
finished bool
}

const kSelection = "selection" // selection key
Expand Down Expand Up @@ -47,6 +48,7 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case tea.KeyMsg:
switch msg.String() {
case "esc", "ctrl+c", "q":
m.finished = true
return m, tea.Quit
}
}
Expand All @@ -67,6 +69,9 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}

func (m *model) View() string {
if m.finished {
return ""
}
return m.form.View()
}

Expand Down
3 changes: 3 additions & 0 deletions cmd/slackdump/internal/wizard/wizard.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ var (
)

func run(m *menu, choice string, onMatch func(cmd *base.Command) error) error {
if choice == "" {
return errBack
}
for _, mi := range m.items {
if choice != mi.Name {
continue
Expand Down

0 comments on commit f6b24d0

Please sign in to comment.