mirror of
https://github.com/psviderski/uncloud.git
synced 2026-10-06 13:18:58 +00:00
feat(pre-deploy): correct progress events for pre-deploy hooks, make other container events more aligned with plan
This commit is contained in:
1 parent
0e820f9c52
commit
0da9df17a4
8 files changed
+111
-28
No files matched your search
@@ -51,3 +51,13 @@ func IsStdinTerminal() bool {
|
||||
func IsStdoutTerminal() bool {
|
||||
return term.IsTerminal(int(os.Stdout.Fd()))
|
||||
}
|
||||
|
||||
// TerminalWidth returns the width of the terminal.
|
||||
// Returns 0 if stdout is not a terminal or the width cannot be determined.
|
||||
func TerminalWidth() int {
|
||||
width, _, err := term.GetSize(int(os.Stdout.Fd()))
|
||||
if err != nil || width <= 0 {
|
||||
return 0
|
||||
}
|
||||
return width
|
||||
}
|
||||
Reference in new issue
Block a user