Skip to content

Commit

Permalink
fix: bring back tty into ci detection (vercel#3589)
Browse files Browse the repository at this point in the history
vercel#3586 changed how we calculate `IsCI` and dropped the `!IsTTY` start to
the calculation. This breaks our cmdutil tests as they require the
`IsCI` flag to be true when the test is running.

We need `IsCI` to be true otherwise we won't look at
`VERCEL_ARTIFACTS_TOKEN` as a possible token source.
  • Loading branch information
chris-olszewski authored Feb 2, 2023
1 parent b4c22a5 commit 3d3f1a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/internal/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const ansiEscapeStr = "[\u001B\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-
var IsTTY = isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd())

// IsCI is true when we appear to be running in a non-interactive context.
var IsCI = ci.IsCi()
var IsCI = !IsTTY || ci.IsCi()
var gray = color.New(color.Faint)
var bold = color.New(color.Bold)
var ERROR_PREFIX = color.New(color.Bold, color.FgRed, color.ReverseVideo).Sprint(" ERROR ")
Expand Down

0 comments on commit 3d3f1a0

Please sign in to comment.