diff --git a/gshmm.go b/gshmm.go index 53473ab..637f8ad 100644 --- a/gshmm.go +++ b/gshmm.go @@ -4,6 +4,7 @@ import ( "flag" "fmt" "os" + "path/filepath" "strings" "github.com/charmbracelet/bubbles/textinput" @@ -44,8 +45,20 @@ func initialModel() model { input := textinput.New() input.Focus() - // TODO(d1): gather actual datasheets - ds := []string{"foo", "bar", "baz", "bing"} + var ds []string + // TODO(d1): handle error in interface? + _ = filepath.Walk(".", func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + + name := info.Name() + if strings.HasSuffix(name, "pdf") { + ds = append(ds, name) + } + + return nil + }) return model{ filterInput: input,