MCPcopy Index your code
hub / github.com/coder/coder / templateMessage

Method templateMessage

cli/templatepush.go:377–389  ·  view source on GitHub ↗
(inv *serpent.Invocation)

Source from the content-addressed store, hash-verified

375}
376
377func (pf *templateUploadFlags) templateMessage(inv *serpent.Invocation) string {
378 title := strings.SplitN(pf.message, "\n", 2)[0]
379 if len(title) > 72 {
380 cliui.Warn(inv.Stdout, "Template message is longer than 72 characters, it will be displayed as truncated.")
381 }
382 if title != pf.message {
383 cliui.Warn(inv.Stdout, "Template message contains newlines, only the first line will be displayed.")
384 }
385 if pf.message != "" {
386 return pf.message
387 }
388 return "Uploaded from the CLI"
389}
390
391func (pf *templateUploadFlags) templateName(inv *serpent.Invocation) (string, error) {
392 args := inv.Args

Callers 2

templateCreateMethod · 0.80
templatePushMethod · 0.80

Calls 1

WarnFunction · 0.92

Tested by

no test coverage detected