Skip to content

Commit

Permalink
{cli} Remove unused context
Browse files Browse the repository at this point in the history
  • Loading branch information
asmaloney committed Mar 2, 2024
1 parent 7dc932b commit deedc40
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
4 changes: 0 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,6 @@ func setupForRun(cmd *cobra.Command) (settings *cli.Settings, err error) {

settings.ActiveFrameworks = frameworks

context := cli.NewContext(cmd.Context(), settings)

cmd.SetContext(context)

return
}

Expand Down
19 changes: 1 addition & 18 deletions util/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
package cli

import (
"context"
"errors"
"fmt"
"os"
"path/filepath"
"runtime"

"github.com/asmaloney/gactar/framework"

"github.com/asmaloney/gactar/util/filesystem"
)

Expand All @@ -25,23 +25,6 @@ type Settings struct {

Version string // the version string for output to command line
}
type settingsKey string

var contextKey settingsKey = "cli"

func NewContext(ctx context.Context, u *Settings) context.Context {
return context.WithValue(ctx, contextKey, u)
}

func FromContext(ctx context.Context) (*Settings, error) {
u, ok := ctx.Value(contextKey).(*Settings)

if !ok {
return nil, ErrInvalidContext
}

return u, nil
}

// SetupPaths will set PATH and VIRTUAL_ENV environment variables to our environment path.
func SetupPaths(envPath string) (err error) {
Expand Down

0 comments on commit deedc40

Please sign in to comment.