cmd builds an exec.Cmd rooted in the project directory with a clean child environment. The context controls process lifetime.
(ctx context.Context, bin string, args ...string)
| 457 | // cmd builds an exec.Cmd rooted in the project directory with a |
| 458 | // clean child environment. The context controls process lifetime. |
| 459 | func (c *devConfig) cmd(ctx context.Context, bin string, args ...string) *exec.Cmd { |
| 460 | cmd := exec.CommandContext(ctx, bin, args...) |
| 461 | cmd.Dir = c.projectRoot |
| 462 | cmd.Env = slices.Clone(c.childEnv) |
| 463 | return cmd |
| 464 | } |
| 465 | |
| 466 | // parseEnvFileFlag extracts the --env-file value from os.Args and |
| 467 | // CODER_DEV_ENV_FILE before serpent runs, so that loaded variables |