"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "cmd/gh/main.go" between
gh-cli-1.10.3.tar.gz and gh-cli-1.11.0.tar.gz

About: GitHub CLI is GitHub’s official command line tool.

main.go  (gh-cli-1.10.3):main.go  (gh-cli-1.11.0)
skipping to change at line 24 skipping to change at line 24
surveyCore "github.com/AlecAivazis/survey/v2/core" surveyCore "github.com/AlecAivazis/survey/v2/core"
"github.com/AlecAivazis/survey/v2/terminal" "github.com/AlecAivazis/survey/v2/terminal"
"github.com/cli/cli/api" "github.com/cli/cli/api"
"github.com/cli/cli/internal/build" "github.com/cli/cli/internal/build"
"github.com/cli/cli/internal/config" "github.com/cli/cli/internal/config"
"github.com/cli/cli/internal/ghinstance" "github.com/cli/cli/internal/ghinstance"
"github.com/cli/cli/internal/ghrepo" "github.com/cli/cli/internal/ghrepo"
"github.com/cli/cli/internal/run" "github.com/cli/cli/internal/run"
"github.com/cli/cli/internal/update" "github.com/cli/cli/internal/update"
"github.com/cli/cli/pkg/cmd/alias/expand" "github.com/cli/cli/pkg/cmd/alias/expand"
"github.com/cli/cli/pkg/cmd/extensions"
"github.com/cli/cli/pkg/cmd/factory" "github.com/cli/cli/pkg/cmd/factory"
"github.com/cli/cli/pkg/cmd/root" "github.com/cli/cli/pkg/cmd/root"
"github.com/cli/cli/pkg/cmdutil" "github.com/cli/cli/pkg/cmdutil"
"github.com/cli/cli/utils" "github.com/cli/cli/utils"
"github.com/cli/safeexec" "github.com/cli/safeexec"
"github.com/mattn/go-colorable" "github.com/mattn/go-colorable"
"github.com/mgutz/ansi" "github.com/mgutz/ansi"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
skipping to change at line 143 skipping to change at line 144
} }
externalCmd := exec.Command(exe, expandedArgs[1:]...) externalCmd := exec.Command(exe, expandedArgs[1:]...)
externalCmd.Stderr = os.Stderr externalCmd.Stderr = os.Stderr
externalCmd.Stdout = os.Stdout externalCmd.Stdout = os.Stdout
externalCmd.Stdin = os.Stdin externalCmd.Stdin = os.Stdin
preparedCmd := run.PrepareCmd(externalCmd) preparedCmd := run.PrepareCmd(externalCmd)
err = preparedCmd.Run() err = preparedCmd.Run()
if err != nil { if err != nil {
if ee, ok := err.(*exec.ExitError); ok { var execError *exec.ExitError
return exitCode(ee.ExitCode()) if errors.As(err, &execError) {
return exitCode(execError.ExitCode())
} }
fmt.Fprintf(stderr, "failed to run external comma nd: %s", err) fmt.Fprintf(stderr, "failed to run external comma nd: %s", err)
return exitError return exitError
} }
return exitOK return exitOK
} else if c, _, err := rootCmd.Traverse(expandedArgs); err == nil
&& c == rootCmd && len(expandedArgs) > 0 {
extensionManager := extensions.NewManager()
if found, err := extensionManager.Dispatch(expandedArgs,
os.Stdin, os.Stdout, os.Stderr); err != nil {
var execError *exec.ExitError
if errors.As(err, &execError) {
return exitCode(execError.ExitCode())
}
fmt.Fprintf(stderr, "failed to run extension: %s"
, err)
return exitError
} else if found {
return exitOK
}
} }
} }
cs := cmdFactory.IOStreams.ColorScheme() cs := cmdFactory.IOStreams.ColorScheme()
if cmd != nil && cmdutil.IsAuthCheckEnabled(cmd) && !cmdutil.CheckAuth(cf g) { if cmd != nil && cmdutil.IsAuthCheckEnabled(cmd) && !cmdutil.CheckAuth(cf g) {
fmt.Fprintln(stderr, cs.Bold("Welcome to GitHub CLI!")) fmt.Fprintln(stderr, cs.Bold("Welcome to GitHub CLI!"))
fmt.Fprintln(stderr) fmt.Fprintln(stderr)
fmt.Fprintln(stderr, "To authenticate, please run `gh auth login` .") fmt.Fprintln(stderr, "To authenticate, please run `gh auth login` .")
return exitAuth return exitAuth
skipping to change at line 267 skipping to change at line 280
if !shouldCheckForUpdate() { if !shouldCheckForUpdate() {
return nil, nil return nil, nil
} }
client, err := basicClient(currentVersion) client, err := basicClient(currentVersion)
if err != nil { if err != nil {
return nil, err return nil, err
} }
repo := updaterEnabled repo := updaterEnabled
stateFilePath := filepath.Join(config.ConfigDir(), "state.yml") stateFilePath := filepath.Join(config.StateDir(), "state.yml")
return update.CheckForUpdate(client, stateFilePath, repo, currentVersion) return update.CheckForUpdate(client, stateFilePath, repo, currentVersion)
} }
// BasicClient returns an API client for github.com only that borrows from but // BasicClient returns an API client for github.com only that borrows from but
// does not depend on user configuration // does not depend on user configuration
func basicClient(currentVersion string) (*api.Client, error) { func basicClient(currentVersion string) (*api.Client, error) {
var opts []api.ClientOption var opts []api.ClientOption
if verbose := os.Getenv("DEBUG"); verbose != "" { if verbose := os.Getenv("DEBUG"); verbose != "" {
opts = append(opts, apiVerboseLog()) opts = append(opts, apiVerboseLog())
} }
 End of changes. 5 change blocks. 
4 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)