Skip to content

chore: read template tar from stdin if stdin is not a tty #14643

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

Conversation

ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Sep 11, 2024

Closes #13203.

coder templates push currently only reads the template tar from stdin if the --directory flag is set to -. This is kind of awkward, and as seen in the attached issue, easy to miss. We can already check if the command is being piped to, so this is just a minor QOL improvement.

This breaks one valid albeit odd workflow, where a confirmation is piped into the command instead of using --yes/-y:

e.g:

echo 'yes' | coder templates push

would no longer work as expected.

Also updates isTTY to isTTYIn, since the name suggests it could check either stdin or stdout, but it only checks stdin, and isTTYOut already exists.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @ethanndickson and the rest of your teammates on Graphite Graphite

@ethanndickson ethanndickson marked this pull request as ready for review September 11, 2024 12:39
@ethanndickson ethanndickson force-pushed the 09-11-chore_read_template_tar_from_stdin_if_stdin_is_not_a_tty branch from 8079188 to cbc1ab9 Compare September 12, 2024 03:40
@ethanndickson ethanndickson force-pushed the 09-11-chore_read_template_tar_from_stdin_if_stdin_is_not_a_tty branch from cbc1ab9 to 423d43b Compare September 12, 2024 03:54
@ethanndickson ethanndickson merged commit efd532e into main Sep 12, 2024
27 checks passed
@ethanndickson ethanndickson deleted the 09-11-chore_read_template_tar_from_stdin_if_stdin_is_not_a_tty branch September 12, 2024 04:36
@github-actions github-actions bot locked and limited conversation to collaborators Sep 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Pushing a template with a symbolically linked module fails
2 participants