Skip to content

Commit c3c019c

Browse files
author
Gabriel Monroy
committed
fix(deisctl): dont print newlines for global units
1 parent d21bb1a commit c3c019c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

deisctl/backend/fleet/state.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,12 @@ func printUnitSubState(name string, outchan chan *schema.Unit, errchan chan erro
175175

176176
func printUnitState(name string, outchan chan *schema.Unit, errchan chan error) error {
177177
// print output while jobs are transitioning
178-
defer fmt.Printf("\n")
178+
newline := true
179+
defer func() {
180+
if newline == true {
181+
fmt.Printf("\n")
182+
}
183+
}()
179184
for {
180185
select {
181186
case u := <-outchan:
@@ -189,6 +194,7 @@ func printUnitState(name string, outchan chan *schema.Unit, errchan chan error)
189194
}
190195
// HACK: global units have no soul
191196
if u.CurrentState == "" {
197+
newline = false
192198
continue
193199
}
194200
// otherwise print output

0 commit comments

Comments
 (0)