It is possible to specify custom certificate paths or path patterns for action keychain add-certificates via CLI option --certificate. As this option accepts either path literals, or a glob patterns to match certificates, then relative reference . to current directory should also be an acceptable input. This however results in an error when globbing matches:
>>> list(Path().glob('.'))
Traceback (most recent call last):
File "/Users/priit/development/nevercode/cli-tools/.venv/lib/python3.12/site-packages/IPython/core/interactiveshell.py", line 3553, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-23-b1f87bcdf599>", line 1, in <cell line: 0>
list(Path().glob('.'))
File "/Users/priit/.pyenv/versions/3.12.0/lib/python3.12/pathlib.py", line 1094, in glob
selector = _make_selector(tuple(pattern_parts), self._flavour, case_sensitive)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/priit/.pyenv/versions/3.12.0/lib/python3.12/pathlib.py", line 83, in _make_selector
pat = pattern_parts[0]
~~~~~~~~~~~~~^^^
IndexError: tuple index out of range
To overcome that limitation, just resolve the relative path pattern before attempting glob search. Then the path becomes absolute which can be safely globbed.
It is possible to specify custom certificate paths or path patterns for action
keychain add-certificates
via CLI option--certificate
. As this option accepts either path literals, or a glob patterns to match certificates, then relative reference.
to current directory should also be an acceptable input. This however results in an error when globbing matches:To overcome that limitation, just resolve the relative path pattern before attempting glob search. Then the path becomes absolute which can be safely globbed.
Updated actions:
keychain add-certificates