(command string, args []string, sleepSeconds int, silent bool)
| 655 | } |
| 656 | |
| 657 | func runCommandWithWait(command string, args []string, sleepSeconds int, silent bool) error { |
| 658 | for { |
| 659 | cmd := exec.Command(command, args...) |
| 660 | if !silent { |
| 661 | cmd.Stdout = os.Stdout |
| 662 | cmd.Stderr = os.Stderr |
| 663 | } |
| 664 | fmt.Printf("running command %s with args %v\n", command, args) |
| 665 | err := cmd.Run() |
| 666 | if err != nil { |
| 667 | log.Warningf("error running command: %v", err) |
| 668 | fmt.Printf("command failed, retrying after %d seconds\n", sleepSeconds) |
| 669 | time.Sleep(time.Duration(sleepSeconds) * time.Second) |
| 670 | continue |
| 671 | } |
| 672 | return nil |
| 673 | } |
| 674 | } |
| 675 | |
| 676 | // prependPathListEnvvar prepends a specified list of strings to a specified envvar and returns its value. |
| 677 | func prependPathListEnvvar(envvar string, prepend ...string) string { |
no test coverage detected