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

This commit is contained in:
Ethan
2024-09-12 14:36:20 +10:00
committed by GitHub
parent d6154c4310
commit efd532e1d7
4 changed files with 23 additions and 16 deletions
+3 -3
View File
@@ -74,7 +74,7 @@ func (r *RootCmd) templateCreate() *serpent.Command {
return err
}
templateName, err := uploadFlags.templateName(inv.Args)
templateName, err := uploadFlags.templateName(inv)
if err != nil {
return err
}
@@ -96,7 +96,7 @@ func (r *RootCmd) templateCreate() *serpent.Command {
message := uploadFlags.templateMessage(inv)
var varsFiles []string
if !uploadFlags.stdin() {
if !uploadFlags.stdin(inv) {
varsFiles, err = codersdk.DiscoverVarsFiles(uploadFlags.directory)
if err != nil {
return err
@@ -139,7 +139,7 @@ func (r *RootCmd) templateCreate() *serpent.Command {
return err
}
if !uploadFlags.stdin() {
if !uploadFlags.stdin(inv) {
_, err = cliui.Prompt(inv, cliui.PromptOptions{
Text: "Confirm create?",
IsConfirm: true,