Skip to content

Commit 88759c8

Browse files
authored
Automatically create directory if not exist (#43)
Test: get-apks and non-existance directory automatically created.
1 parent f5ced37 commit 88759c8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

android_unpinner/__main__.py

+2
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ def get_apks(package: str, outdir: Path) -> None:
363363
if not package_info.startswith("package:"):
364364
raise RuntimeError(f"Unxepected output from pm path: {package_info!r}")
365365
apks = [p.removeprefix("package:") for p in package_info.splitlines()]
366+
if not outdir.exists():
367+
Path.mkdir(outdir)
366368
for apk in apks:
367369
logging.info(f"Getting {apk}...")
368370
outfile = outdir / Path(apk).name

0 commit comments

Comments
 (0)