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

Method TranspileConfig

shell/shell.go:356–370  ·  view source on GitHub ↗

TranspileConfig transpiles the .cosh startup config file in the user's home directory if it exists.

()

Source from the content-addressed store, hash-verified

354// TranspileConfig transpiles the .cosh startup config file in the user's
355// home directory if it exists.
356func (sh *Shell) TranspileConfig() error {
357 path, err := homedir.Expand("~/.cosh")
358 if err != nil {
359 return err
360 }
361 b, err := os.ReadFile(path)
362 if err != nil {
363 if errors.Is(err, fs.ErrNotExist) {
364 return nil
365 }
366 return err
367 }
368 sh.TranspileCode(string(b))
369 return nil
370}
371
372// AddHistory adds given line to the Hist record of commands
373func (sh *Shell) AddHistory(line string) {

Callers 1

RunConfigMethod · 0.80

Calls 3

TranspileCodeMethod · 0.95
IsFunction · 0.92
ReadFileMethod · 0.80

Tested by

no test coverage detected