Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Diogenesoftoronto committed Sep 29, 2023
1 parent bcdd59a commit d159c87
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tui/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package main
import (
"errors"
"fmt"
"os"
"strings"
"time"

"github.com/Diogenesoftoronto/ardi/internal/mets"
mets "github.com/Diogenesoftoronto/ardi/internal/mets"
"github.com/charmbracelet/bubbles/filepicker"
tea "github.com/charmbracelet/bubbletea"
)
Expand Down Expand Up @@ -89,5 +90,13 @@ func (m model) View() string {
func main() {
fp := filepicker.New()
// allowed extensions
fp.AllowedTypes = [mets.ZIP, mets.TAR, mets.Z7, mets.XML]
fp.AllowedTypes = []string{mets.ZIP, mets.TAR, mets.Z7, mets.XML}
fp.CurrentDirectory, _ = os.UserHomeDir()

m := model{
picker: fp,
}
tm, _ := tea.NewProgram(&m, tea.WithOutput(os.Stderr)).Run()
mm := tm.(model)
fmt.Println("\n You selected: " + m.picker.Styles.Selected.Render(mm.selected) + "\n")
}

0 comments on commit d159c87

Please sign in to comment.