Skip to content

Commit

Permalink
fix(WVD): Add exists/empty checks to WVD folder dumps
Browse files Browse the repository at this point in the history
  • Loading branch information
rlaphoenix committed Apr 1, 2024
1 parent f99fad8 commit 3b33459
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion devine/commands/wvd.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,15 @@ def dump(wvd_paths: list[Path], out_dir: Path) -> None:
log = logging.getLogger("wvd")

if wvd_paths == ():
wvd_paths = list(config.directories.wvds.iterdir())
if not config.directories.wvds.exists():
console.log(f"[bright_blue]{config.directories.wvds.absolute()}[/] does not exist...")
wvd_paths = list(
x
for x in config.directories.wvds.iterdir()
if x.is_file() and x.suffix.lower() == ".wvd"
)
if not wvd_paths:
console.log(f"[bright_blue]{config.directories.wvds.absolute()}[/] is empty...")

for i, (wvd_path, out_path) in enumerate(zip(wvd_paths, (out_dir / x.stem for x in wvd_paths))):
if i > 0:
Expand Down

0 comments on commit 3b33459

Please sign in to comment.