fix: skip first line bug, adjust argument descriptions

This commit is contained in:
parker
2025-10-05 17:54:58 +01:00
parent cf2c1fb070
commit 8a6a439326
2 changed files with 20 additions and 6 deletions

View File

@@ -16,8 +16,22 @@ def parse_args() -> argparse.Namespace:
epilog="If you have any questions let me know at parker@parkerbritt.com" epilog="If you have any questions let me know at parker@parkerbritt.com"
) )
parser.add_argument("--shows-directory", default="/shows", help="Specifies the directory shows are contained within.") parser.add_argument(
parser.add_argument("--paths-file", help="Specifies a file containing show paths to inspect and validate.") "--shows-directory",
default="/shows",
help=(
"Root directory containing all show projects. "
"Defaults to '/shows'. "
"Use this to specify a different base path if your projects are stored elsewhere, for example in testing environments."
)
)
parser.add_argument(
"--paths-file",
help=(
"Path to a text file listing the directories "
"to inspect and validate. Each line in the file should contain one directory path."
)
)
return parser.parse_args() return parser.parse_args()

View File

@@ -49,12 +49,12 @@ def validate_paths_from_file(parsed_args: argparse.Namespace, file: str) -> None
with open(file, "r") as f: with open(file, "r") as f:
line = f.readline() line = f.readline()
while(line): while(line):
line = f.readline()
if(should_skip_line(line)):
continue
# clean line # clean line
path = line.strip() path = line.strip()
line = f.readline()
if(should_skip_line(path)):
continue
# validate path # validate path
if(not validate_path(parsed_args, path)): if(not validate_path(parsed_args, path)):