Add optional parameter to prompt_path function

Modify prompt_path function to add optional parameter for path existence check.
This commit is contained in:
GladistonXD
2026-01-28 10:10:24 -03:00
committed by GitHub
parent 57aa8d20b6
commit 62293b15c2
+2 -2
View File
@@ -22,9 +22,9 @@ def _raise_response_exception(response: requests.Response):
)
def prompt_path(is_file: bool, initial_path: Path, description: str) -> Path:
def prompt_path(is_file: bool, initial_path: Path, description: str, optional: bool = False) -> Path:
path_validator = click.Path(
exists=True,
exists=not optional,
file_okay=is_file,
dir_okay=not is_file,
path_type=Path,