(command, task_name, output_path, tasks)
| 21 | return remaining_tasks |
| 22 | |
| 23 | def run_command(command, task_name, output_path, tasks): |
| 24 | try: |
| 25 | result = subprocess.run(command, stdout=subprocess.PIPE, shell=True, timeout=60) |
| 26 | try: |
| 27 | output = result.stdout.decode("UTF-8", errors="ignore") |
| 28 | except: |
| 29 | output = result.stdout.decode("ISO-8859-1", errors="ignore") |
| 30 | if output is not None: |
| 31 | with open(os.path.join(output_path, f"{task_name}.txt"), "w") as f: |
| 32 | f.write(output) |
| 33 | else: |
| 34 | print("[-] No output for task {}".format(task_name)) |
| 35 | remaining_tasks = get_remaining_tasks(output_path, tasks) |
| 36 | if len(remaining_tasks) > 0: |
| 37 | print(f"[*] {random_emoji()}尚未执行的任务:{','.join(remaining_tasks)}") |
| 38 | except subprocess.TimeoutExpired: |
| 39 | print(f"[-] {task_name} timed out after 60 seconds.") |
| 40 | except Exception as e: |
| 41 | print("[-] {} \n[-] Error while running command: {}".format(command, str(e))) |
| 42 | |
| 43 | def generate_markdown(tasks, output_path, tasklist, tasklist_help, task_filescanlist, task_filescanlist_help): |
| 44 | markdown = "" |
nothing calls this directly
no test coverage detected