cmds.secrets.CmdXX: Add option --all

Support option --all to jw-pkg.py secrets list-compilation-output and
list-secrets (CmdListCompilationOutput & CmdSecrets). This allows
them to also report non-existent files.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-03-08 07:43:37 +01:00
commit 1ffac7b365
3 changed files with 26 additions and 6 deletions

View file

@ -206,11 +206,23 @@ class Cmd(Base): # export
async def _list_template_files(self, packages: Iterable[str]) -> list[str]:
return await self._match_files(packages, pattern=r'.*\.jw-tmpl$')
async def _list_secret_paths(self, packages: Iterable[str]) -> list[str]:
return [str(Path(f).with_suffix(".jw-secret")) for f in await self._list_template_files(packages)]
async def _list_secret_paths(self, packages: Iterable[str], ignore_missing: bool=False) -> list[str]:
ret = []
for tmpl in await self._list_template_files(packages):
path = str(Path(tmpl).with_suffix(".jw-secret"))
if ignore_missing and not os.path.exists(path):
continue
ret.append(path)
return ret
async def _list_compilation_targets(self, packages: Iterable[str]) -> list[str]:
return [f.removesuffix('.jw-tmpl') for f in await self._list_template_files(packages)]
async def _list_compilation_targets(self, packages: Iterable[str], ignore_missing: bool=False) -> list[str]:
ret = []
for tmpl in await self._list_template_files(packages):
path = tmpl.removesuffix('.jw-tmpl')
if ignore_missing and not os.path.exists(path):
continue
ret.append(path)
return ret
async def _remove_compilation_targets(self, packages: Iterable[str]) -> list[str]:
for path in await self._list_compilation_targets(packages):