version: use golang.org/x/term to check terminal

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi
2021-05-19 14:04:49 -07:00
parent c9da1088b1
commit 36b20c6f9c
3 changed files with 5 additions and 63 deletions

View File

@@ -12,10 +12,10 @@ import (
"strings"
"time"
"github.com/cli/cli/utils"
goVersion "github.com/hashicorp/go-version"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"golang.org/x/term"
)
const (
@@ -72,7 +72,7 @@ func init() {
func isCheckOutdated(path string) bool {
// Ignore if not in terminal
if !utils.IsTerminal(os.Stdout) || !utils.IsTerminal(os.Stderr) {
if !term.IsTerminal(int(os.Stdout.Fd())) || !term.IsTerminal(int(os.Stderr.Fd())) {
return false
}