Merge pull request #998 from MichaelMure/fix/996/create-env-once

fix(commands): create env.Env once for all Cobra commands
This commit is contained in:
Michael Muré 2023-01-18 08:21:08 +01:00 committed by GitHub
commit 2484867089
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
41 changed files with 83 additions and 142 deletions

View File

@ -7,9 +7,7 @@ import (
"github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/commands/execenv"
) )
func NewBridgeCommand() *cobra.Command { func NewBridgeCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "bridge", Use: "bridge",
Short: "List bridges to other bug trackers", Short: "List bridges to other bug trackers",
@ -20,11 +18,11 @@ func NewBridgeCommand() *cobra.Command {
Args: cobra.NoArgs, Args: cobra.NoArgs,
} }
cmd.AddCommand(newBridgeAuthCommand()) cmd.AddCommand(newBridgeAuthCommand(env))
cmd.AddCommand(newBridgeNewCommand()) cmd.AddCommand(newBridgeNewCommand(env))
cmd.AddCommand(newBridgePullCommand()) cmd.AddCommand(newBridgePullCommand(env))
cmd.AddCommand(newBridgePushCommand()) cmd.AddCommand(newBridgePushCommand(env))
cmd.AddCommand(newBridgeRm()) cmd.AddCommand(newBridgeRm(env))
return cmd return cmd
} }

View File

@ -12,9 +12,7 @@ import (
"github.com/MichaelMure/git-bug/util/colors" "github.com/MichaelMure/git-bug/util/colors"
) )
func newBridgeAuthCommand() *cobra.Command { func newBridgeAuthCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "auth", Use: "auth",
Short: "List all known bridge authentication credentials", Short: "List all known bridge authentication credentials",
@ -25,9 +23,9 @@ func newBridgeAuthCommand() *cobra.Command {
Args: cobra.NoArgs, Args: cobra.NoArgs,
} }
cmd.AddCommand(newBridgeAuthAddTokenCommand()) cmd.AddCommand(newBridgeAuthAddTokenCommand(env))
cmd.AddCommand(newBridgeAuthRm()) cmd.AddCommand(newBridgeAuthRm(env))
cmd.AddCommand(newBridgeAuthShow()) cmd.AddCommand(newBridgeAuthShow(env))
return cmd return cmd
} }

View File

@ -24,8 +24,7 @@ type bridgeAuthAddTokenOptions struct {
user string user string
} }
func newBridgeAuthAddTokenCommand() *cobra.Command { func newBridgeAuthAddTokenCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
options := bridgeAuthAddTokenOptions{} options := bridgeAuthAddTokenOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

View File

@ -8,9 +8,7 @@ import (
"github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/commands/execenv"
) )
func newBridgeAuthRm() *cobra.Command { func newBridgeAuthRm(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "rm BRIDGE_ID", Use: "rm BRIDGE_ID",
Short: "Remove a credential", Short: "Remove a credential",

View File

@ -13,9 +13,7 @@ import (
"github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/commands/execenv"
) )
func newBridgeAuthShow() *cobra.Command { func newBridgeAuthShow(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "show", Use: "show",
Short: "Display an authentication credential", Short: "Display an authentication credential",

View File

@ -26,8 +26,7 @@ type bridgeNewOptions struct {
nonInteractive bool nonInteractive bool
} }
func newBridgeNewCommand() *cobra.Command { func newBridgeNewCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
options := bridgeNewOptions{} options := bridgeNewOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

View File

@ -23,8 +23,7 @@ type bridgePullOptions struct {
noResume bool noResume bool
} }
func newBridgePullCommand() *cobra.Command { func newBridgePullCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
options := bridgePullOptions{} options := bridgePullOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

View File

@ -15,9 +15,7 @@ import (
"github.com/MichaelMure/git-bug/util/interrupt" "github.com/MichaelMure/git-bug/util/interrupt"
) )
func newBridgePushCommand() *cobra.Command { func newBridgePushCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "push [NAME]", Use: "push [NAME]",
Short: "Push updates to remote bug tracker", Short: "Push updates to remote bug tracker",

View File

@ -8,9 +8,7 @@ import (
"github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/commands/execenv"
) )
func newBridgeRm() *cobra.Command { func newBridgeRm(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "rm NAME", Use: "rm NAME",
Short: "Delete a configured bridge", Short: "Delete a configured bridge",

View File

@ -34,8 +34,7 @@ type bugOptions struct {
outputFormat string outputFormat string
} }
func NewBugCommand() *cobra.Command { func NewBugCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
options := bugOptions{} options := bugOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{
@ -107,16 +106,16 @@ git bug status:open --by creation "foo bar" baz
child.GroupID = groupID child.GroupID = groupID
} }
addCmdWithGroup(newBugDeselectCommand(), selectGroup) addCmdWithGroup(newBugDeselectCommand(env), selectGroup)
addCmdWithGroup(newBugSelectCommand(), selectGroup) addCmdWithGroup(newBugSelectCommand(env), selectGroup)
cmd.AddCommand(newBugCommentCommand()) cmd.AddCommand(newBugCommentCommand(env))
cmd.AddCommand(newBugLabelCommand()) cmd.AddCommand(newBugLabelCommand(env))
cmd.AddCommand(newBugNewCommand()) cmd.AddCommand(newBugNewCommand(env))
cmd.AddCommand(newBugRmCommand()) cmd.AddCommand(newBugRmCommand(env))
cmd.AddCommand(newBugShowCommand()) cmd.AddCommand(newBugShowCommand(env))
cmd.AddCommand(newBugStatusCommand()) cmd.AddCommand(newBugStatusCommand(env))
cmd.AddCommand(newBugTitleCommand()) cmd.AddCommand(newBugTitleCommand(env))
return cmd return cmd
} }

View File

@ -8,9 +8,7 @@ import (
"github.com/MichaelMure/git-bug/util/colors" "github.com/MichaelMure/git-bug/util/colors"
) )
func newBugCommentCommand() *cobra.Command { func newBugCommentCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "comment [BUG_ID]", Use: "comment [BUG_ID]",
Short: "List a bug's comments", Short: "List a bug's comments",
@ -21,8 +19,8 @@ func newBugCommentCommand() *cobra.Command {
ValidArgsFunction: BugCompletion(env), ValidArgsFunction: BugCompletion(env),
} }
cmd.AddCommand(newBugCommentNewCommand()) cmd.AddCommand(newBugCommentNewCommand(env))
cmd.AddCommand(newBugCommentEditCommand()) cmd.AddCommand(newBugCommentEditCommand(env))
return cmd return cmd
} }

View File

@ -14,8 +14,7 @@ type bugCommentNewOptions struct {
nonInteractive bool nonInteractive bool
} }
func newBugCommentNewCommand() *cobra.Command { func newBugCommentNewCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
options := bugCommentNewOptions{} options := bugCommentNewOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

View File

@ -13,8 +13,7 @@ type bugCommentEditOptions struct {
nonInteractive bool nonInteractive bool
} }
func newBugCommentEditCommand() *cobra.Command { func newBugCommentEditCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
options := bugCommentEditOptions{} options := bugCommentEditOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

View File

@ -10,6 +10,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/MichaelMure/git-bug/commands/bug/testenv" "github.com/MichaelMure/git-bug/commands/bug/testenv"
"github.com/MichaelMure/git-bug/commands/cmdtest"
"github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/commands/execenv"
) )

View File

@ -8,9 +8,7 @@ import (
"github.com/MichaelMure/git-bug/entities/bug" "github.com/MichaelMure/git-bug/entities/bug"
) )
func newBugDeselectCommand() *cobra.Command { func newBugDeselectCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "deselect", Use: "deselect",
Short: "Clear the implicitly selected bug", Short: "Clear the implicitly selected bug",

View File

@ -6,9 +6,7 @@ import (
"github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/commands/execenv"
) )
func newBugLabelCommand() *cobra.Command { func newBugLabelCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "label [BUG_ID]", Use: "label [BUG_ID]",
Short: "Display labels of a bug", Short: "Display labels of a bug",
@ -19,8 +17,8 @@ func newBugLabelCommand() *cobra.Command {
ValidArgsFunction: BugCompletion(env), ValidArgsFunction: BugCompletion(env),
} }
cmd.AddCommand(newBugLabelNewCommand()) cmd.AddCommand(newBugLabelNewCommand(env))
cmd.AddCommand(newBugLabelRmCommand()) cmd.AddCommand(newBugLabelRmCommand(env))
return cmd return cmd
} }

View File

@ -7,9 +7,7 @@ import (
"github.com/MichaelMure/git-bug/util/text" "github.com/MichaelMure/git-bug/util/text"
) )
func newBugLabelNewCommand() *cobra.Command { func newBugLabelNewCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "new [BUG_ID] LABEL...", Use: "new [BUG_ID] LABEL...",
Short: "Add a label to a bug", Short: "Add a label to a bug",

View File

@ -7,9 +7,7 @@ import (
"github.com/MichaelMure/git-bug/util/text" "github.com/MichaelMure/git-bug/util/text"
) )
func newBugLabelRmCommand() *cobra.Command { func newBugLabelRmCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "rm [BUG_ID] LABEL...", Use: "rm [BUG_ID] LABEL...",
Short: "Remove a label from a bug", Short: "Remove a label from a bug",

View File

@ -15,8 +15,7 @@ type bugNewOptions struct {
nonInteractive bool nonInteractive bool
} }
func newBugNewCommand() *cobra.Command { func newBugNewCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
options := bugNewOptions{} options := bugNewOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

View File

@ -8,9 +8,7 @@ import (
"github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/commands/execenv"
) )
func newBugRmCommand() *cobra.Command { func newBugRmCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "rm BUG_ID", Use: "rm BUG_ID",
Short: "Remove an existing bug", Short: "Remove an existing bug",

View File

@ -15,9 +15,7 @@ func ResolveSelected(repo *cache.RepoCache, args []string) (*cache.BugCache, []s
return _select.Resolve[*cache.BugCache](repo, bug.Typename, bug.Namespace, repo.Bugs(), args) return _select.Resolve[*cache.BugCache](repo, bug.Typename, bug.Namespace, repo.Bugs(), args)
} }
func newBugSelectCommand() *cobra.Command { func newBugSelectCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "select BUG_ID", Use: "select BUG_ID",
Short: "Select a bug for implicit use in future commands", Short: "Select a bug for implicit use in future commands",

View File

@ -19,8 +19,7 @@ type bugShowOptions struct {
format string format string
} }
func newBugShowCommand() *cobra.Command { func newBugShowCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
options := bugShowOptions{} options := bugShowOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

View File

@ -6,9 +6,7 @@ import (
"github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/commands/execenv"
) )
func newBugStatusCommand() *cobra.Command { func newBugStatusCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "status [BUG_ID]", Use: "status [BUG_ID]",
Short: "Display the status of a bug", Short: "Display the status of a bug",
@ -19,8 +17,8 @@ func newBugStatusCommand() *cobra.Command {
ValidArgsFunction: BugCompletion(env), ValidArgsFunction: BugCompletion(env),
} }
cmd.AddCommand(newBugStatusCloseCommand()) cmd.AddCommand(newBugStatusCloseCommand(env))
cmd.AddCommand(newBugStatusOpenCommand()) cmd.AddCommand(newBugStatusOpenCommand(env))
return cmd return cmd
} }

View File

@ -6,9 +6,7 @@ import (
"github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/commands/execenv"
) )
func newBugStatusCloseCommand() *cobra.Command { func newBugStatusCloseCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "close [BUG_ID]", Use: "close [BUG_ID]",
Short: "Mark a bug as closed", Short: "Mark a bug as closed",

View File

@ -6,9 +6,7 @@ import (
"github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/commands/execenv"
) )
func newBugStatusOpenCommand() *cobra.Command { func newBugStatusOpenCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "open [BUG_ID]", Use: "open [BUG_ID]",
Short: "Mark a bug as open", Short: "Mark a bug as open",

View File

@ -6,9 +6,7 @@ import (
"github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/commands/execenv"
) )
func newBugTitleCommand() *cobra.Command { func newBugTitleCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "title [BUG_ID]", Use: "title [BUG_ID]",
Short: "Display the title of a bug", Short: "Display the title of a bug",
@ -19,7 +17,7 @@ func newBugTitleCommand() *cobra.Command {
ValidArgsFunction: BugCompletion(env), ValidArgsFunction: BugCompletion(env),
} }
cmd.AddCommand(newBugTitleEditCommand()) cmd.AddCommand(newBugTitleEditCommand(env))
return cmd return cmd
} }

View File

@ -13,8 +13,7 @@ type bugTitleEditOptions struct {
nonInteractive bool nonInteractive bool
} }
func newBugTitleEditCommand() *cobra.Command { func newBugTitleEditCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
options := bugTitleEditOptions{} options := bugTitleEditOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

View File

@ -12,8 +12,7 @@ type commandOptions struct {
desc bool desc bool
} }
func newCommandsCommand() *cobra.Command { func newCommandsCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
options := commandOptions{} options := commandOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

View File

@ -6,9 +6,7 @@ import (
"github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/commands/execenv"
) )
func newLabelCommand() *cobra.Command { func newLabelCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "label", Use: "label",
Short: "List valid labels", Short: "List valid labels",

View File

@ -10,9 +10,7 @@ import (
"github.com/MichaelMure/git-bug/entity" "github.com/MichaelMure/git-bug/entity"
) )
func newPullCommand() *cobra.Command { func newPullCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "pull [REMOTE]", Use: "pull [REMOTE]",
Short: "Pull updates from a git remote", Short: "Pull updates from a git remote",

View File

@ -9,9 +9,7 @@ import (
"github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/commands/execenv"
) )
func newPushCommand() *cobra.Command { func newPushCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "push [REMOTE]", Use: "push [REMOTE]",
Short: "Push updates to a git remote", Short: "Push updates to a git remote",

View File

@ -7,10 +7,10 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/MichaelMure/git-bug/commands/bridge" bridgecmd "github.com/MichaelMure/git-bug/commands/bridge"
"github.com/MichaelMure/git-bug/commands/bug" bugcmd "github.com/MichaelMure/git-bug/commands/bug"
"github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/commands/execenv"
"github.com/MichaelMure/git-bug/commands/user" usercmd "github.com/MichaelMure/git-bug/commands/user"
) )
// These variables are initialized externally during the build. See the Makefile. // These variables are initialized externally during the build. See the Makefile.
@ -68,20 +68,22 @@ the same git remote you are already using to collaborate with other people.
child.GroupID = groupID child.GroupID = groupID
} }
addCmdWithGroup(bugcmd.NewBugCommand(), entityGroup) env := execenv.NewEnv()
addCmdWithGroup(usercmd.NewUserCommand(), entityGroup)
addCmdWithGroup(newLabelCommand(), entityGroup)
addCmdWithGroup(newTermUICommand(), uiGroup) addCmdWithGroup(bugcmd.NewBugCommand(env), entityGroup)
addCmdWithGroup(newWebUICommand(), uiGroup) addCmdWithGroup(usercmd.NewUserCommand(env), entityGroup)
addCmdWithGroup(newLabelCommand(env), entityGroup)
addCmdWithGroup(newPullCommand(), remoteGroup) addCmdWithGroup(newTermUICommand(env), uiGroup)
addCmdWithGroup(newPushCommand(), remoteGroup) addCmdWithGroup(newWebUICommand(env), uiGroup)
addCmdWithGroup(bridgecmd.NewBridgeCommand(), remoteGroup)
cmd.AddCommand(newCommandsCommand()) addCmdWithGroup(newPullCommand(env), remoteGroup)
cmd.AddCommand(newVersionCommand()) addCmdWithGroup(newPushCommand(env), remoteGroup)
cmd.AddCommand(newWipeCommand()) addCmdWithGroup(bridgecmd.NewBridgeCommand(env), remoteGroup)
cmd.AddCommand(newCommandsCommand(env))
cmd.AddCommand(newVersionCommand(env))
cmd.AddCommand(newWipeCommand(env))
return cmd return cmd
} }

View File

@ -7,9 +7,7 @@ import (
"github.com/MichaelMure/git-bug/termui" "github.com/MichaelMure/git-bug/termui"
) )
func newTermUICommand() *cobra.Command { func newTermUICommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "termui", Use: "termui",
Aliases: []string{"tui"}, Aliases: []string{"tui"},

View File

@ -16,8 +16,7 @@ type userOptions struct {
format string format string
} }
func NewUserCommand() *cobra.Command { func NewUserCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
options := userOptions{} options := userOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{
@ -29,9 +28,9 @@ func NewUserCommand() *cobra.Command {
}), }),
} }
cmd.AddCommand(newUserNewCommand()) cmd.AddCommand(newUserNewCommand(env))
cmd.AddCommand(newUserShowCommand()) cmd.AddCommand(newUserShowCommand(env))
cmd.AddCommand(newUserAdoptCommand()) cmd.AddCommand(newUserAdoptCommand(env))
flags := cmd.Flags() flags := cmd.Flags()
flags.SortFlags = false flags.SortFlags = false

View File

@ -7,9 +7,7 @@ import (
"github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/commands/execenv"
) )
func newUserAdoptCommand() *cobra.Command { func newUserAdoptCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "adopt USER_ID", Use: "adopt USER_ID",
Short: "Adopt an existing identity as your own", Short: "Adopt an existing identity as your own",

View File

@ -14,9 +14,7 @@ type userNewOptions struct {
nonInteractive bool nonInteractive bool
} }
func newUserNewCommand() *cobra.Command { func newUserNewCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
options := userNewOptions{} options := userNewOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "new", Use: "new",

View File

@ -16,8 +16,7 @@ type userShowOptions struct {
fields string fields string
} }
func newUserShowCommand() *cobra.Command { func newUserShowCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
options := userShowOptions{} options := userShowOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

View File

@ -14,8 +14,7 @@ type versionOptions struct {
all bool all bool
} }
func newVersionCommand() *cobra.Command { func newVersionCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
options := versionOptions{} options := versionOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

View File

@ -42,8 +42,7 @@ type webUIOptions struct {
query string query string
} }
func newWebUICommand() *cobra.Command { func newWebUICommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
options := webUIOptions{} options := webUIOptions{}
cmd := &cobra.Command{ cmd := &cobra.Command{

View File

@ -6,9 +6,7 @@ import (
"github.com/MichaelMure/git-bug/commands/execenv" "github.com/MichaelMure/git-bug/commands/execenv"
) )
func newWipeCommand() *cobra.Command { func newWipeCommand(env *execenv.Env) *cobra.Command {
env := execenv.NewEnv()
cmd := &cobra.Command{ cmd := &cobra.Command{
Use: "wipe", Use: "wipe",
Short: "Wipe git-bug from the git repository", Short: "Wipe git-bug from the git repository",

2
go.mod
View File

@ -114,7 +114,7 @@ require (
go.etcd.io/bbolt v1.3.5 // indirect go.etcd.io/bbolt v1.3.5 // indirect
golang.org/x/mod v0.7.0 // indirect golang.org/x/mod v0.7.0 // indirect
golang.org/x/net v0.5.0 // indirect golang.org/x/net v0.5.0 // indirect
golang.org/x/term v0.4.0 // indirect golang.org/x/term v0.4.0
golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect
golang.org/x/tools v0.4.0 // indirect golang.org/x/tools v0.4.0 // indirect
golang.org/x/vuln v0.0.0-20220908155419-5537ad2271a7 golang.org/x/vuln v0.0.0-20220908155419-5537ad2271a7