diff --git a/pkgs/clan-cli/clan_cli/flake.py b/pkgs/clan-cli/clan_cli/flake.py index 58d16ec99..7bb53706d 100644 --- a/pkgs/clan-cli/clan_cli/flake.py +++ b/pkgs/clan-cli/clan_cli/flake.py @@ -344,9 +344,6 @@ class FlakeCacheEntry: def is_cached(self, selectors: list[Selector]) -> bool: selector: Selector - if selectors == []: - return self.fetched_all - selector = selectors[0] # for store paths we have to check if they still exist, otherwise they have to be rebuild and are thus not cached if isinstance(self.value, str) and self.value.startswith("/nix/store/"): @@ -356,6 +353,10 @@ class FlakeCacheEntry: if isinstance(self.value, str | float | int | None): return True + if selectors == []: + return self.fetched_all + selector = selectors[0] + # we just fetch all subkeys, so we need to check of we inserted all keys at this level before if selector.type == SelectorType.ALL: assert isinstance(self.value, dict)