mach: Avoid python error when there's no cargo cache.

This commit is contained in:
Josh Matthews 2018-08-01 20:52:17 -04:00 committed by GitHub
parent 451c52e18d
commit 458879b2cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -366,6 +366,7 @@ class MachCommands(CommandBase):
elif os.path.isdir(path.join(git_db_dir, d)):
packages["git"][crate_name]["exist"].append(("del", d, ""))
if crates_src_dir:
for d in os.listdir(crates_src_dir):
crate_name = re.sub(r"\-\d+(\.\d+){1,3}.+", "", d)
if not packages["crates"].get(crate_name, False):