Skip to content

Fix CLI checking for content #161

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

Merged
merged 1 commit into from
Sep 28, 2022
Merged

Fix CLI checking for content #161

merged 1 commit into from
Sep 28, 2022

Conversation

kddnewton
Copy link
Member

Previously, we were checking if $stdin was a TTY to determine if there was content to be read. As it turns out, this isn't really a good indicator, as content could always come later, and some folks run stree in CI when $stdin is not a TTY and still pass filenames.

Instead, we now check if no filenames were passed, and in that case we attempt to read from $stdin.

Fixes #159

Previously, we were checking if $stdin was a TTY to determine if
there was content to be read. As it turns out, this isn't really a
good indicator, as content could always come later, and some folks
run stree in CI when $stdin is not a TTY and still pass filenames.

Instead, we now check if no filenames were passed, and in that case
we attempt to read from $stdin.
@kddnewton kddnewton merged commit 5c02d72 into main Sep 28, 2022
@kddnewton kddnewton deleted the fix-cli branch September 28, 2022 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug with passing arguments for non-tty stdin.
1 participant