fix(cli): Fix crash in templateflow get when matching one file#140
Merged
mgxd merged 4 commits intotemplateflow:masterfrom Aug 12, 2025
Merged
fix(cli): Fix crash in templateflow get when matching one file#140mgxd merged 4 commits intotemplateflow:masterfrom
mgxd merged 4 commits intotemplateflow:masterfrom
Conversation
8831981 to
389a442
Compare
Contributor
Author
|
Rebased onto #143 to fix tests. |
Contributor
Author
|
Given that the only failing test was unrelated and this was here for 8 months without objection, merging by lazy consensus after CI finishes unless someone wants to have a quick look. |
mgxd
approved these changes
Aug 12, 2025
Contributor
mgxd
left a comment
There was a problem hiding this comment.
A few suggestions, looks good as is
mgxd
reviewed
Aug 12, 2025
| click.echo('\n'.join(f'{match}' for match in api.get(template, **entities))) | ||
| paths = api.get(template, **entities) | ||
| filenames = [str(paths)] if isinstance(paths, Path) else [str(file) for file in paths] | ||
| click.echo('\n'.join(filenames)) |
Contributor
There was a problem hiding this comment.
perhaps past the reach of this PR - but it would be nice to print out a more helpful message with empty lists, i.e.
Suggested change
| click.echo('\n'.join(filenames)) | |
| if not filenames: | |
| click.echo('No files found.') | |
| return | |
| click.echo('\n'.join(filenames)) |
Contributor
Author
There was a problem hiding this comment.
One currently useful feature is that the output is filenames. Helpful messages on stderr are fine, but I wouldn't want to change the utility of stdout to bash scripts.
Fine for another PR, but I don't want to scope creep this one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently: