Skip to content

Commit

Permalink
testing charm fix
Browse files Browse the repository at this point in the history
  • Loading branch information
robinovitch61 committed Jan 28, 2024
1 parent 1112c1e commit 8e0db71
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 58 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func bindFlags(cmd *cobra.Command, nameToArg map[string]arg) {
func mainEntrypoint(cmd *cobra.Command, args []string) {
dev.Debug("~STARTING UP~")
rootOpts := getRootOpts(cmd)
initialModel, options := setup(cmd, rootOpts, "")
initialModel, options := setup(cmd, rootOpts, "", nil)
program := tea.NewProgram(initialModel, options...)

if _, err := program.Run(); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,6 @@ func generateTeaHandler(cmd *cobra.Command) func(ssh.Session) (tea.Model, []tea.
if sshCommands := s.Command(); len(sshCommands) == 1 {
overrideToken = strings.TrimSpace(sshCommands[0])
}
return setup(cmd, changedOpts, overrideToken)
return setup(cmd, changedOpts, overrideToken, s)
}
}
4 changes: 2 additions & 2 deletions cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ func getRootOpts(cmd *cobra.Command) []string {
return opts
}

func setup(cmd *cobra.Command, rootOpts []string, overrideToken string) (app.Model, []tea.ProgramOption) {
initialModel := app.InitialModel(getConfig(cmd, rootOpts, overrideToken))
func setup(cmd *cobra.Command, rootOpts []string, overrideToken string, session ssh.Session) (app.Model, []tea.ProgramOption) {
initialModel := app.InitialModel(getConfig(cmd, rootOpts, overrideToken), session)
return initialModel, []tea.ProgramOption{tea.WithAltScreen()}
}
33 changes: 18 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,30 @@ require (
github.com/atotto/clipboard v0.1.4
github.com/carlmjohnson/versioninfo v0.22.4
github.com/charmbracelet/bubbles v0.16.1
github.com/charmbracelet/bubbletea v0.24.2
github.com/charmbracelet/lipgloss v0.7.1
github.com/charmbracelet/ssh v0.0.0-20221117183211-483d43d97103
github.com/charmbracelet/wish v1.1.1
github.com/charmbracelet/bubbletea v0.25.0
github.com/charmbracelet/lipgloss v0.9.1
github.com/charmbracelet/ssh v0.0.0-20240118173142-6d7cf11c8371
github.com/charmbracelet/wish v1.2.1-0.20240122121046-e5d20f514768
github.com/hashicorp/nomad/api v0.0.0-20230619092614-e29ad68c588d
github.com/itchyny/gojq v0.12.13
github.com/moby/term v0.5.0
github.com/olekukonko/tablewriter v0.0.5
github.com/spf13/cobra v1.7.0
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.16.0
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
)

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/caarlos0/sshmarshal v0.1.0 // indirect
github.com/charmbracelet/keygen v0.4.2 // indirect
github.com/charmbracelet/log v0.2.2 // indirect
github.com/charmbracelet/keygen v0.5.0 // indirect
github.com/charmbracelet/log v0.3.1 // indirect
github.com/charmbracelet/x/errors v0.0.0-20240117030013-d31dba354651 // indirect
github.com/charmbracelet/x/exp/term v0.0.0-20240117031359-6e25c76a1efe // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/creack/pty v1.1.21 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
Expand All @@ -43,24 +45,25 @@ require (
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.15.1 // indirect
github.com/muesli/termenv v0.15.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
golang.org/x/crypto v0.10.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/term v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
github.com/u-root/u-root v0.11.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 8e0db71

Please sign in to comment.