From 86aede4ffc72e2fbb21f718b97fa8e767159af46 Mon Sep 17 00:00:00 2001 From: sapetnioc Date: Fri, 7 Jun 2024 13:22:16 +0200 Subject: [PATCH] #7 more cleanup --- bin/neuro-forge | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/neuro-forge b/bin/neuro-forge index a5845a7..d921a0d 100755 --- a/bin/neuro-forge +++ b/bin/neuro-forge @@ -59,13 +59,15 @@ def init(channel_dir): if variants.exists(): command.extend(["-m", str(variants)]) check_call(command) + # Cleanup and create channel index - for i in ("bld", "src_cache", ".rattler", ".cache"): - to_delete = channel_dir / i - if to_delete.exists(): - shutil.rmtree(to_delete) check_call(["conda", "index", channel_dir]) + to_delete = [channel_dir / i for i in ("bld", "src_cache", ".rattler", ".cache")] + to_delete.extend(channel_dir.glob("*/.cache")) + for i in to_delete: + if i.exists(): + shutil.rmtree(i) if save_datalad: check_call( ["datalad", "save", "-m", "Created initial packages", str(channel_dir)]