cmds.secrets.lib.DistroContext.list_template_files(): List more

Default to Distro's idea of relevant packages if no packages are
specified on the command line.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-04-21 11:20:42 +02:00
commit 32c3477102
Signed by: jan
GPG key ID: 3750640C9E25DD61

View file

@ -34,6 +34,8 @@ class DistroContext(FilesContext):
return ret return ret
async def list_template_files(self, pkg_names: Iterable[str]) -> list[str]: async def list_template_files(self, pkg_names: Iterable[str]) -> list[str]:
if not pkg_names:
pkg_names = [p.name for p in await self.__distro.select()]
return await self.match_files(pkg_names, pattern=r'.*\.jw-tmpl$') return await self.match_files(pkg_names, pattern=r'.*\.jw-tmpl$')
async def list_secret_paths(self, pkg_names: Iterable[str], ignore_missing: bool=False) -> list[str]: async def list_secret_paths(self, pkg_names: Iterable[str], ignore_missing: bool=False) -> list[str]: