Skip to content

Commit

Permalink
Merge pull request #28 from wesen/misc/adapt-new-fs-command-loader-api
Browse files Browse the repository at this point in the history
🎨 ⬆️ Use new generic loadCommands API
  • Loading branch information
wesen committed Feb 9, 2023
2 parents 02726ea + 8dc5527 commit 478cb10
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
7 changes: 5 additions & 2 deletions cmd/pinocchio/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/go-go-golems/geppetto/cmd/pinocchio/cmds/openai"
"github.com/go-go-golems/geppetto/cmd/pinocchio/cmds/openai/ui"
"github.com/go-go-golems/geppetto/pkg/cmds"
glazed_cmds "github.com/go-go-golems/glazed/pkg/cmds"
"github.com/go-go-golems/glazed/pkg/help"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -90,15 +91,17 @@ func init() {
{
FS: promptsFS,
Name: "embed",
Root: "prompts/",
Root: ".",
DocRoot: "prompts/doc",
},
},
Repositories: repositories,
}

yamlLoader := glazed_cmds.NewYAMLFSCommandLoader(
&cmds.GeppettoCommandLoader{}, "", "")
commands, aliases, err := locations.LoadCommands(
&cmds.GeppettoCommandLoader{}, helpSystem, rootCmd)
yamlLoader, helpSystem, rootCmd)
if err != nil {
_, _ = fmt.Fprintf(os.Stderr, "Error initializing commands: %s\n", err)
os.Exit(1)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ require (
github.com/charmbracelet/bubbles v0.15.0
github.com/charmbracelet/bubbletea v0.23.1
github.com/charmbracelet/lipgloss v0.6.0
github.com/go-go-golems/clay v0.0.0-20230209040950-078286f571ee
github.com/go-go-golems/glazed v0.2.5-0.20230209040643-10add7791234
github.com/go-go-golems/clay v0.0.0-20230209230840-8ae39b3e6203
github.com/go-go-golems/glazed v0.2.5-0.20230209230455-03ed8a509375
github.com/mb0/glob v0.0.0-20160210091149-1eb79d2de6c4
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.29.0
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,10 @@ github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-go-golems/clay v0.0.0-20230209040950-078286f571ee h1:fJ3k93DJJKvEVHzK2qNoToW0juR+LP2U66qhfdACOls=
github.com/go-go-golems/clay v0.0.0-20230209040950-078286f571ee/go.mod h1:0fsM9SjCsIkCGcjpVdWyIK6s8FRADE/rsCqZz7bNDyk=
github.com/go-go-golems/glazed v0.2.5-0.20230209040643-10add7791234 h1:oRq7CX3cT8z6CBlwvHk/fMdgzE+VkOmndCyDVzYf6Rk=
github.com/go-go-golems/glazed v0.2.5-0.20230209040643-10add7791234/go.mod h1:lGQ+K9u8+YQdAd8EiYBsOjrZAAdZvV/0tW0TlmZII5s=
github.com/go-go-golems/clay v0.0.0-20230209230840-8ae39b3e6203 h1:vSiEJ2G5qJnfPB6T8O2YPfHAVvCXNMPEvUfn5RRUqBk=
github.com/go-go-golems/clay v0.0.0-20230209230840-8ae39b3e6203/go.mod h1:LqabI6hsNhBihiZ9p0DrjGln5B/zi9ngP8QZksloG6E=
github.com/go-go-golems/glazed v0.2.5-0.20230209230455-03ed8a509375 h1:pg3zNqK5H0TQi+xZ3J5Xl+hGWiPHf3qMPGE4pYeKZEU=
github.com/go-go-golems/glazed v0.2.5-0.20230209230455-03ed8a509375/go.mod h1:lGQ+K9u8+YQdAd8EiYBsOjrZAAdZvV/0tW0TlmZII5s=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
Expand Down

0 comments on commit 478cb10

Please sign in to comment.