Skip to content

Commit

Permalink
fix: 🔥 remove spew
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuar committed Jan 14, 2025
1 parent 9cc85c7 commit 27fed4a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 0 additions & 4 deletions internal/cli/runCmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import (
"os/signal"
"syscall"

"github.com/davecgh/go-spew/spew"

"github.com/joshuar/go-hass-agent/internal/agent"
"github.com/joshuar/go-hass-agent/internal/hass"
"github.com/joshuar/go-hass-agent/internal/logging"
Expand All @@ -34,8 +32,6 @@ func (r *RunCmd) Run(opts *CmdOpts) error {

ctx = preferences.PathToCtx(ctx, opts.Path)

spew.Dump(opts.Path)

// Load the preferences from file. Ignore the case where there are no
// existing preferences.
if err := preferences.Load(ctx,
Expand Down
3 changes: 3 additions & 0 deletions internal/preferences/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@ func MQTTPrefsFromFromCtx(ctx context.Context) *MQTT {
return prefs
}

// PathToCtx stores the base path for preferences (and other files) in the
// context.
func PathToCtx(ctx context.Context, path string) context.Context {
return context.WithValue(ctx, pathCtxKey, path)
}

// PathFromCtx retrieves the base path for preferences from the context.
func PathFromCtx(ctx context.Context) string {
path, ok := ctx.Value(pathCtxKey).(string)
if !ok {
Expand Down

0 comments on commit 27fed4a

Please sign in to comment.