Skip to content

Commit

Permalink
Create ui.go
Browse files Browse the repository at this point in the history
Signed-off-by: gitworkflows <118260833+gitworkflows@users.noreply.github.com>
  • Loading branch information
gitworkflows authored Sep 23, 2024
1 parent 9c73a9e commit 80804a3
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions internal/ui/ui.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package ui

import (
"github.com/khulnasoft/go-pulsebus"
)

type UI func(<-chan error, *pulsebus.Subscription) error

// Select is responsible for determining the specific UI function given select user option, the current platform
// config values, and environment status (such as a TTY being present).
func Select() UI {
// verbose, quiet bool
var ui UI

//isStdoutATty := terminal.IsTerminal(int(os.Stdout.Fd()))
//isStderrATty := terminal.IsTerminal(int(os.Stderr.Fd()))
//notATerminal := !isStderrATty && !isStdoutATty

switch {
//case runtime.GOOS == "windows" || verbose || quiet || notATerminal || !isStderrATty:
// ui = logger
default:
ui = etui
//ui = nop
}

return ui
}

0 comments on commit 80804a3

Please sign in to comment.