mirror of
https://github.com/glomatico/votify.git
synced 2026-10-02 22:12:21 +02:00
Add optional parameter to prompt_path function
Modify prompt_path function to add optional parameter for path existence check.
This commit is contained in:
+2
-2
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user