MCPcopy Create free account
hub / github.com/cogentcore/core / Source

Method Source

shell/builtins.go:162–171  ·  view source on GitHub ↗

Source loads and evaluates the given file(s)

(cmdIO *exec.CmdIO, args ...string)

Source from the content-addressed store, hash-verified

160
161// Source loads and evaluates the given file(s)
162func (sh *Shell) Source(cmdIO *exec.CmdIO, args ...string) error {
163 if len(args) == 0 {
164 return fmt.Errorf("cosh source: requires at least one argument")
165 }
166 for _, fn := range args {
167 sh.TranspileCodeFromFile(fn)
168 }
169 // note that we do not execute the file -- just loads it in
170 return nil
171}
172
173// CoSSH manages SSH connections, which are referenced by the @name
174// identifier. It handles the following cases:

Callers 1

gendexFunction · 0.80

Calls 2

TranspileCodeFromFileMethod · 0.95
ErrorfMethod · 0.65

Tested by

no test coverage detected