diff --git a/core/authflow/success.go b/core/authflow/success.go index 9f0389b5197..ff0eb9f08e2 100644 --- a/core/authflow/success.go +++ b/core/authflow/success.go @@ -33,7 +33,7 @@ const oauthSuccessPage = ` }
- +You may now close this tab and return to the terminal.
diff --git a/core/container/main.go b/core/container/main.go index 8395a36d4bc..f7dff1726ef 100644 --- a/core/container/main.go +++ b/core/container/main.go @@ -54,7 +54,7 @@ func mainRun() exitCode { hasDebug := os.Getenv("DEBUG") != "" - cmdFactory := factory.New(buildVersion) + cmdFactory := factory.New() stderr := cmdFactory.IOStreams.ErrOut if !cmdFactory.IOStreams.ColorEnabled() { surveyCore.DisableColor = true diff --git a/pkg/cmd/factory/default.go b/pkg/cmd/factory/default.go index e1433c89f40..de6938d2a0b 100644 --- a/pkg/cmd/factory/default.go +++ b/pkg/cmd/factory/default.go @@ -13,7 +13,7 @@ import ( "github.com/secman-team/gh-api/pkg/iostreams" ) -func New(appVersion string) *cmdutil.Factory { +func New() *cmdutil.Factory { io := iostreams.System() var cachedConfig config.Config @@ -52,7 +52,7 @@ func New(appVersion string) *cmdutil.Factory { return nil, err } - return NewHTTPClient(io, cfg, appVersion, true), nil + return NewHTTPClient(io, cfg, "x", true), nil }, BaseRepo: func() (ghrepo.Interface, error) { remotes, err := remotesFunc() diff --git a/pkg/cmd/repo/repo.go b/pkg/cmd/repo/repo.go index 96b6d8aa76b..099a78e4180 100644 --- a/pkg/cmd/repo/repo.go +++ b/pkg/cmd/repo/repo.go @@ -1,6 +1,8 @@ package repo import ( + "os" + "fmt" "github.com/MakeNowJust/heredoc" repoCloneCmd "github.com/secman-team/gh-api/pkg/cmd/repo/clone" repoCreateCmd "github.com/secman-team/gh-api/pkg/cmd/repo/create" @@ -11,8 +13,25 @@ import ( repoViewCmd "github.com/secman-team/gh-api/pkg/cmd/repo/view" "github.com/secman-team/gh-api/pkg/cmdutil" "github.com/spf13/cobra" + "github.com/abdfnx/git_config" + "github.com/secman-team/gh-api/pkg/cmd/factory" + "github.com/secman-team/gh-api/pkg/iostreams" ) +type ColorScheme struct { + IO *iostreams.IOStreams +} + +func opts(f *cmdutil.Factory) ColorScheme { + opts := ColorScheme{ + IO: f.IOStreams, + } + + return opts +} + +var cs = opts(factory.New()).IO.ColorScheme() + func NewCmdRepo(f *cmdutil.Factory) *cobra.Command { cmd := &cobra.Command{ Use: "repo