diff options
| author | Frederick Muriuki Muriithi <fredmanglis@gmail.com> | 2026-09-25 10:37:20 -0500 |
|---|---|---|
| committer | Frederick Muriuki Muriithi <fredmanglis@gmail.com> | 2026-09-28 09:47:36 -0500 |
| commit | 5e4d6d5c5755fbe057d101b62f95208a3afa4ade (patch) | |
| tree | 2688a73f0b4e1f2b8a30bcc5c6c8797c83390901 /scripts/cli/validators.py | |
| parent | c590b5226e8e2f65e8ef85c77d4d24a8d423a4c4 (diff) | |
| download | gn-uploader-5e4d6d5c5755fbe057d101b62f95208a3afa4ade.tar.gz | |
Initialise scripts for genotype uploads files' processing.
Diffstat (limited to 'scripts/cli/validators.py')
| -rw-r--r-- | scripts/cli/validators.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/cli/validators.py b/scripts/cli/validators.py index 6d16e4c..dc198f5 100644 --- a/scripts/cli/validators.py +++ b/scripts/cli/validators.py @@ -2,6 +2,14 @@ from pathlib import Path +def file_exists(val: str) -> Path: + """Ensure the file path specified actually exists.""" + _file = Path(val) + if _file.exists() and _file.is_file(): + return _file + raise FileNotFoundError(f"Could not find the file '{_file}'.") + + def directory_exists(val: str) -> Path: """Check that directory path specified actually exists.""" _dir = Path(val).absolute() |
