Create parent directories too in artifacts download

This commit is contained in:
Daniele Varrazzo 2021-11-12 14:52:31 +01:00
parent 217f4120ca
commit 846ae52ab2
2 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
"""Download packages from github actions artifacts """Download packages from appveyor artifacts
""" """
import os import os
@ -76,7 +76,7 @@ def main():
) )
resp.raise_for_status() resp.raise_for_status()
if not dest.parent.exists(): if not dest.parent.exists():
dest.parent.mkdir() dest.parent.mkdir(parents=True)
with dest.open("wb") as f: with dest.open("wb") as f:
f.write(resp.content) f.write(resp.content)

View File

@ -60,7 +60,7 @@ def main():
dest = Path("packages") dest = Path("packages")
if not dest.exists(): if not dest.exists():
logger.info(f"creating dir {dest}") logger.info(f"creating dir {dest}")
dest.mkdir() dest.mkdir(parents=True)
for artifact in artifacts: for artifact in artifacts:
logger.info(f"downloading {artifact['name']} archive") logger.info(f"downloading {artifact['name']} archive")