Skip to content

Commit b4d1f56

Browse files
committed
fix(cli): Fix crash in templateflow get when matching one file
1 parent 951404e commit b4d1f56

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

templateflow/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ def ls(template, **kwargs):
141141
def get(template, **kwargs):
142142
"""Fetch the assets corresponding to template and optional filters."""
143143
entities = {k: _nulls(v) for k, v in kwargs.items() if v != ''}
144-
click.echo('\n'.join(f'{match}' for match in api.get(template, **entities)))
144+
paths = api.get(template, **entities)
145+
filenames = [str(paths)] if isinstance(paths, Path) else [str(file) for file in paths]
146+
click.echo('\n'.join(filenames))
145147

146148

147149
if __name__ == '__main__':

0 commit comments

Comments
 (0)