mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Auto merge of #20789 - Eijebong:fix-clean-cache, r=jdm
Don't try to list files in directories that don't exist Fixes #20784 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20789) <!-- Reviewable:end -->
This commit is contained in:
commit
d9d11b39ca
1 changed files with 8 additions and 2 deletions
|
@ -234,8 +234,14 @@ class MachCommands(CommandBase):
|
|||
git_dir = path.join(cargo_dir, "git")
|
||||
git_db_dir = path.join(git_dir, "db")
|
||||
git_checkout_dir = path.join(git_dir, "checkouts")
|
||||
git_db_list = filter(lambda f: not f.startswith('.'), os.listdir(git_db_dir))
|
||||
git_checkout_list = os.listdir(git_checkout_dir)
|
||||
if os.path.isdir(git_db_dir):
|
||||
git_db_list = filter(lambda f: not f.startswith('.'), os.listdir(git_db_dir))
|
||||
else:
|
||||
git_db_list = []
|
||||
if os.path.isdir(git_checkout_dir):
|
||||
git_checkout_list = os.listdir(git_checkout_dir)
|
||||
else:
|
||||
git_checkout_list = []
|
||||
|
||||
for d in list(set(git_db_list + git_checkout_list)):
|
||||
crate_name = d.replace("-{}".format(d.split("-")[-1]), "")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue