Commit 7124057 1 parent 9258a44 commit 7124057 Copy full SHA for 7124057
File tree 1 file changed +6
-11
lines changed
1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -68,23 +68,18 @@ func MustRunCommand(cmd string, args ...string) {
68
68
MustRun (exec .Command (cmd , args ... ))
69
69
}
70
70
71
+ // MustRunCommandWithOutput runs the given command, and ensures that some output will be
72
+ // printed while it runs. This is useful for CI builds where the process will be stopped
73
+ // when there is no output.
71
74
func MustRunCommandWithOutput (cmd string , args ... string ) {
72
- var done chan bool
73
- // This is a little loop to generate some output, so CI does not tear down the
74
- // process after 300 seconds.
75
+ interval := time .NewTicker (time .Minute )
76
+ defer interval .Stop ()
75
77
go func () {
76
- for i := 0 ; i < 15 ; i ++ {
78
+ for range interval . C {
77
79
fmt .Printf ("Waiting for command %q\n " , cmd )
78
- select {
79
- case <- time .After (time .Minute ):
80
- break
81
- case <- done :
82
- return
83
- }
84
80
}
85
81
}()
86
82
MustRun (exec .Command (cmd , args ... ))
87
- close (done )
88
83
}
89
84
90
85
var warnedAboutGit bool
You can’t perform that action at this time.
0 commit comments