Repository: cli/cli
File: pkg/cmd/extension/command.go (Go)

Code before:
					$ gh extension install https://git.example.com/owner/gh-extension

					# Install an extension from a local repository in the current working directory
					$ gh extension install .
				`),
				Args: cmdutil.MinimumArgs(1, "must specify a repository to install from"),
				RunE: func(cmd *cobra.Command, args []string) error {
					if args[0] == "." {
						if pinFlag != "" {
							return fmt.Errorf("local extensions cannot be pinned")
						}
						wd, err := os.Getwd()
						if err != nil {
							return err
						}
						_, err = checkValidExtension(cmd.Root(), m, filepath.Base(wd), "")
						if err != nil {
							return err
						}

						err = m.InstallLocal(wd)
						if errors.Is(err, ErrExtensionExecutableNotFound) {
							if io.IsStdoutTTY() {
								fmt.Fprintln(io.ErrOut, err.Error())
							}
							return nil
						}
						return err
					}

					repo, err := ghrepo.FromFullName(args[0])
					if err != nil {
						return err
					}

					cs := io.ColorScheme()

					if ext, err := checkValidExtension(cmd.Root(), m, repo.RepoName(), repo.RepoOwner()); err != nil {
						// If an existing extension was found and --force was specified, attempt to upgrade.
						if forceFlag && ext != nil {
							return upgradeFunc(ext.Name(), forceFlag)
						}

						if errors.Is(err, alreadyInstalledError) {
							fmt.Fprintf(io.ErrOut, "%s Extension %s is already installed\n", cs.WarningIcon(), ghrepo.FullName(repo))
							return nil
						}

						return err
					}


Review comment (bug):
Are there any circumstances where it would be helpful to print this error if not TTY? I imagine someone installing an extension as part of a workflow, this error occurring, and them lacking any useful information to debug it. I did a [code search for `gh extension install`](https://github.com/search?q=%22gh+extension+install%22&type=code) and see a couple examples of this on the first results page.
```suggestion
						if errors.Is(err, ErrExtensionExecutableNotFound) {
							fmt.Fprintln(io.ErrOut, err.Error())
						        return nil
						}
```

Code after:
					$ gh extension install https://my.ghes.com/owner/gh-extension

					# Install an extension from a local repository in the current working directory
					$ gh extension install .
				`),
				Args: cmdutil.MinimumArgs(1, "must specify a repository to install from"),
				RunE: func(cmd *cobra.Command, args []string) error {
					if args[0] == "." {
						if pinFlag != "" {
							return fmt.Errorf("local extensions cannot be pinned")
						}
						wd, err := os.Getwd()
						if err != nil {
							return err
						}
						_, err = checkValidExtension(cmd.Root(), m, filepath.Base(wd), "")
						if err != nil {
							return err
						}

						err = m.InstallLocal(wd)
						var ErrExtensionExecutableNotFound *ErrExtensionExecutableNotFound
						if errors.As(err, &ErrExtensionExecutableNotFound) {
							cs := io.ColorScheme()
							if io.IsStdoutTTY() {
								fmt.Fprintf(io.ErrOut, "%s %s", cs.WarningIcon(), ErrExtensionExecutableNotFound.Error())
							}
							return nil
						}
						return err
					}

					repo, err := ghrepo.FromFullName(args[0])
					if err != nil {
						return err
					}

					cs := io.ColorScheme()

					if ext, err := checkValidExtension(cmd.Root(), m, repo.RepoName(), repo.RepoOwner()); err != nil {
						// If an existing extension was found and --force was specified, attempt to upgrade.
						if forceFlag && ext != nil {
							return upgradeFunc(ext.Name(), forceFlag)
						}

						if errors.Is(err, alreadyInstalledError) {
							fmt.Fprintf(io.ErrOut, "%s Extension %s is already installed\n", cs.WarningIcon(), ghrepo.FullName(repo))
							return nil
						}

						return err