-
Notifications
You must be signed in to change notification settings - Fork 881
feat: add template checkout
command to extract a template to an expanded local directory instead of a tar
#2867
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
old "pull" is "pull" again; new command is "checkout"
template checkout
command to extract a template to an expanded local directory instead of a tar
|
||
func templateCheckout() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "checkout <template name> [destination]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the rationale to make this a separate command from pull
? I feel as though it does essentially the same thing, but --extract
may be clearer to a caller.
I'm concerned of the checkout
name, because of the association with git
.
I'd propose a UX like:
$ coder templates pull <name>
Warning: Binary output can mess up your terminal. Use "--extract -" to tell
Warning: coder to output it to your terminal anyway, or consider "--extract
Warning: <FOLDER>" to extract to a directory.
This output is taken verbatim from curl
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, one reason to make it a separate command is because I think the more common thing will be to download into an unpacked tree, so I don't want people to always have to type --extract
. I'm open to different names, but I chose checkout
precisely because of the similarity with version control systems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkout
gives the appearance that it's checking out a ref if you're familiar with Git. I don't think it'd be synonymous with cloning a repository, which this does.
I think extract is better, but having two commands I think is excessively verbose for what this does. It's not a big deal to type --extract
, and I'm fine to swap the default behavior to extract to a directory too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I'll swap the behaviors and add a --archive
flag.
template checkout
command to extract a template to an expanded local directory instead of a tartemplate checkout
command to extract a template to an expanded local directory instead of a tar
This Pull Request is becoming stale. In order to minimize WIP, prevent merge conflicts and keep the tracker readable, I'm going close to this PR in 3 days if there isn't more activity. |
I need to revisit this. |
This Pull Request is becoming stale. In order to minimize WIP, prevent merge conflicts and keep the tracker readable, I'm going close to this PR in 3 days if there isn't more activity. |
fixes #2651