Run the specified pre-hook if we haven't already. If we've already run this exact command before, a message is logged saying the pre-hook was skipped. :param str command: pre-hook to be run
(command: str)
| 83 | |
| 84 | |
| 85 | def _run_pre_hook_if_necessary(command: str) -> None: |
| 86 | """Run the specified pre-hook if we haven't already. |
| 87 | |
| 88 | If we've already run this exact command before, a message is logged |
| 89 | saying the pre-hook was skipped. |
| 90 | |
| 91 | :param str command: pre-hook to be run |
| 92 | |
| 93 | """ |
| 94 | if command in executed_pre_hooks: |
| 95 | logger.info("Pre-hook command already run, skipping: %s", command) |
| 96 | else: |
| 97 | _run_hook("pre-hook", command) |
| 98 | executed_pre_hooks.add(command) |
| 99 | |
| 100 | |
| 101 | def post_hook( |