(command, cwd, logfile=None, tail_lines=10, tee=False, live=False, shell=None, capture_output=False)
| 1449 | |
| 1450 | |
| 1451 | def run_with_log_tail(command, cwd, logfile=None, tail_lines=10, tee=False, live=False, shell=None, capture_output=False): |
| 1452 | fh = sys.stdout |
| 1453 | if logfile: |
| 1454 | logdir = os.path.dirname(logfile) |
| 1455 | if not os.path.exists(logdir): |
| 1456 | os.makedirs(logdir) |
| 1457 | fh = open(logfile, 'w') |
| 1458 | |
| 1459 | rc, captured_output = run_follow(command, cwd, fh=fh, tee=tee, live=live, shell=shell, capture_output=capture_output) |
| 1460 | |
| 1461 | if logfile: |
| 1462 | fh.close() |
| 1463 | if not tee and tail_lines and tail_lines > 0: |
| 1464 | tail_file(logfile, tail_lines) |
| 1465 | |
| 1466 | return rc, captured_output |
| 1467 | |
| 1468 | |
| 1469 | def ask_yes_no(text): |
no test coverage detected
searching dependent graphs…