File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 55import re
66import shutil
77import site
8+ import sys
89from contextlib import contextmanager
910from functools import lru_cache
1011from pathlib import Path
1112from tempfile import TemporaryDirectory
1213
1314import tomlkit
1415
15- from codeflash .cli_cmds .console import logger
16+ from codeflash .cli_cmds .console import logger , paneled_text
1617from codeflash .code_utils .config_parser import find_pyproject_toml
1718
1819ImportErrorPattern = re .compile (r"ModuleNotFoundError.*$" , re .MULTILINE )
@@ -215,5 +216,11 @@ def restore_conftest(path_to_content_map: dict[Path, str]) -> None:
215216 path .write_text (file_content , encoding = "utf8" )
216217
217218
219+ def exit_with_message (message : str , * , error_on_exit : bool = False ) -> None :
220+ paneled_text (message , panel_args = {"style" : "red" })
221+
222+ sys .exit (1 if error_on_exit else 0 )
223+
224+
218225async def dummy_async_function () -> None :
219226 """Provide a dummy async function for testing purposes."""
You can’t perform that action at this time.
0 commit comments