Save the files for the static web view.
(path: pathlib.Path)
| 20 | |
| 21 | |
| 22 | def save_static(path: pathlib.Path) -> None: |
| 23 | """ |
| 24 | Save the files for the static web view. |
| 25 | """ |
| 26 | # We want to overwrite the static files to keep track of the update. |
| 27 | if (path / "static").exists(): |
| 28 | shutil.rmtree(str(path / "static")) |
| 29 | shutil.copytree(str(web_dir / "static"), str(path / "static")) |
| 30 | shutil.copyfile(str(web_dir / "index.html"), str(path / "index.html")) |
| 31 | |
| 32 | with open(str(path / "static" / "static.js"), "w") as f: |
| 33 | f.write("MITMWEB_STATIC = true;") |
| 34 | |
| 35 | |
| 36 | def save_filter_help(path: pathlib.Path) -> None: |