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

Method stdin

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

Source from the content-addressed store, hash-verified

307}
308
309func (pf *templateUploadFlags) stdin(inv *serpent.Invocation) (out bool) {
310 defer func() {
311 if out {
312 inv.Logger.Info(inv.Context(), "uploading tar read from stdin")
313 }
314 }()
315 // We read a tar from stdin if the directory is "-" or if we're not in a
316 // TTY and the directory flag is unset.
317 return pf.directory == "-" || (!isTTYIn(inv) && !inv.ParsedFlags().Lookup("directory").Changed)
318}
319
320func (pf *templateUploadFlags) upload(inv *serpent.Invocation, client *codersdk.Client) (*codersdk.UploadResponse, error) {
321 var content io.Reader

Callers 5

uploadMethod · 0.95
checkForLockfileMethod · 0.95
templateNameMethod · 0.95
templateCreateMethod · 0.80
templatePushMethod · 0.80

Calls 3

isTTYInFunction · 0.85
ContextMethod · 0.65
InfoMethod · 0.45

Tested by

no test coverage detected