main: create intermediate directories for cachedir
Fixes: https://pagure.io/fedora-rust/rust2rpm/issue/50 Merges: https://pagure.io/fedora-rust/rust2rpm/pull-request/56
This commit is contained in:
parent
0e3c6e777c
commit
2c1e19f4eb
1 changed files with 1 additions and 2 deletions
|
@ -101,8 +101,7 @@ def download(crate, version):
|
||||||
versions = req.json()["versions"]
|
versions = req.json()["versions"]
|
||||||
version = next(version["num"] for version in versions if not version["yanked"])
|
version = next(version["num"] for version in versions if not version["yanked"])
|
||||||
|
|
||||||
if not os.path.isdir(CACHEDIR):
|
os.makedirs(CACHEDIR, exist_ok=True)
|
||||||
os.mkdir(CACHEDIR)
|
|
||||||
cratef_base = "{}-{}.crate".format(crate, version)
|
cratef_base = "{}-{}.crate".format(crate, version)
|
||||||
cratef = os.path.join(CACHEDIR, cratef_base)
|
cratef = os.path.join(CACHEDIR, cratef_base)
|
||||||
if not os.path.isfile(cratef):
|
if not os.path.isfile(cratef):
|
||||||
|
|
Loading…
Reference in a new issue