MCPcopy
hub / github.com/go-task/task / readTaskfile

Method readTaskfile

setup.go:75–108  ·  view source on GitHub ↗
(node taskfile.Node)

Source from the content-addressed store, hash-verified

73}
74
75func (e *Executor) readTaskfile(node taskfile.Node) error {
76 ctx, cf := context.WithTimeout(context.Background(), e.Timeout)
77 defer cf()
78 debugFunc := func(s string) {
79 e.Logger.VerboseOutf(logger.Magenta, s)
80 }
81 promptFunc := func(s string) error {
82 return e.Logger.Prompt(logger.Yellow, s, "n", "y", "yes")
83 }
84 reader := taskfile.NewReader(
85 taskfile.WithInsecure(e.Insecure),
86 taskfile.WithDownload(e.Download),
87 taskfile.WithOffline(e.Offline),
88 taskfile.WithTrustedHosts(e.TrustedHosts),
89 taskfile.WithTempDir(e.TempDir.Remote),
90 taskfile.WithCacheExpiryDuration(e.CacheExpiryDuration),
91 taskfile.WithReaderCACert(e.CACert),
92 taskfile.WithReaderCert(e.Cert),
93 taskfile.WithReaderCertKey(e.CertKey),
94 taskfile.WithDebugFunc(debugFunc),
95 taskfile.WithPromptFunc(promptFunc),
96 )
97 graph, err := reader.Read(ctx, node)
98 if err != nil {
99 if errors.Is(err, context.DeadlineExceeded) {
100 return &errors.TaskfileNetworkTimeoutError{URI: node.Location(), Timeout: e.Timeout}
101 }
102 return err
103 }
104 if e.Taskfile, err = graph.Merge(); err != nil {
105 return err
106 }
107 return nil
108}
109
110func (e *Executor) setupFuzzyModel() {
111 if e.Taskfile == nil {

Callers 1

SetupMethod · 0.95

Calls 15

ReadMethod · 0.95
NewReaderFunction · 0.92
WithInsecureFunction · 0.92
WithDownloadFunction · 0.92
WithOfflineFunction · 0.92
WithTrustedHostsFunction · 0.92
WithTempDirFunction · 0.92
WithCacheExpiryDurationFunction · 0.92
WithReaderCACertFunction · 0.92
WithReaderCertFunction · 0.92
WithReaderCertKeyFunction · 0.92
WithDebugFuncFunction · 0.92

Tested by

no test coverage detected