File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed
Expand file tree Collapse file tree 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) {
6868 MustRun (exec .Command (cmd , args ... ))
6969}
7070
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.
7174func 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 ()
7577 go func () {
76- for i := 0 ; i < 15 ; i ++ {
78+ for range interval . C {
7779 fmt .Printf ("Waiting for command %q\n " , cmd )
78- select {
79- case <- time .After (time .Minute ):
80- break
81- case <- done :
82- return
83- }
8480 }
8581 }()
8682 MustRun (exec .Command (cmd , args ... ))
87- close (done )
8883}
8984
9085var warnedAboutGit bool
You can’t perform that action at this time.
0 commit comments