From 20cb7b9255e51795165e1bb30de370a427e26ae2 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Sat, 22 Jan 2022 20:57:59 -0700 Subject: [PATCH] inherit environment from the parent process --- pmuxproc/pmuxproc.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pmuxproc/pmuxproc.go b/pmuxproc/pmuxproc.go index a9469d1..fe6e6e8 100644 --- a/pmuxproc/pmuxproc.go +++ b/pmuxproc/pmuxproc.go @@ -96,9 +96,10 @@ func RunProcessOnce(ctx context.Context, logger Logger, cfg Config) error { } cmd := exec.Command(cfg.Cmd, cfg.Args...) - cmd.Dir = cfg.Dir - cmd.Env = make([]string, 0, len(cfg.Env)) + cmd.Dir = cfg.Dir + cmd.Env = os.Environ() + for k, v := range cfg.Env { cmd.Env = append(cmd.Env, k+"="+v) }