Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pubsub-cli: strip whitespace when reading crashids from stdin #54

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion obs_common/pubsub_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,11 @@ def publish(ctx, project_id, topic_name, crashids):

# Pull crash ids from stdin if there are any
if not crashids and not sys.stdin.isatty():
crashids = list(click.get_text_stream("stdin").readlines())
crashids = [
stripped
for line in click.get_text_stream("stdin")
if (stripped := line.strip()) # ignore empty lines
]

if not crashids:
raise click.BadParameter(
Expand Down