mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 19:13:34 +00:00
feat: add -y|--yes flag for 'us deploy' to auto-confirm deployment plan
This commit is contained in:
+11
-1
@@ -1,6 +1,11 @@
|
||||
package cli
|
||||
|
||||
import "github.com/charmbracelet/huh"
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/charmbracelet/huh"
|
||||
"golang.org/x/term"
|
||||
)
|
||||
|
||||
func Confirm() (bool, error) {
|
||||
var confirmed bool
|
||||
@@ -21,3 +26,8 @@ func Confirm() (bool, error) {
|
||||
|
||||
return confirmed, nil
|
||||
}
|
||||
|
||||
// IsStdinTerminal checks if the standard input is a terminal (TTY).
|
||||
func IsStdinTerminal() bool {
|
||||
return term.IsTerminal(int(os.Stdin.Fd()))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user