TranspileConfig transpiles the .cosh startup config file in the user's home directory if it exists.
()
| 354 | // TranspileConfig transpiles the .cosh startup config file in the user's |
| 355 | // home directory if it exists. |
| 356 | func (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 |
| 373 | func (sh *Shell) AddHistory(line string) { |
no test coverage detected