From 40a4e1de7d329eb797c2607af0a77d0ca1f46397 Mon Sep 17 00:00:00 2001 From: Matt Fellows Date: Tue, 20 Mar 2018 13:05:59 +1100 Subject: [PATCH] feat(utf8): ensure env vars are passed through to all commands --- client/service_manager.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/client/service_manager.go b/client/service_manager.go index d6ac687ce..41a226989 100644 --- a/client/service_manager.go +++ b/client/service_manager.go @@ -101,7 +101,10 @@ func (s *ServiceManager) List() map[int]*exec.Cmd { // Command executes the command func (s *ServiceManager) Command() *exec.Cmd { cmd := exec.Command(s.Cmd, s.Args...) - cmd.Env = s.Env + env := os.Environ() + env = append(env, s.Env...) + cmd.Env = env + return cmd } @@ -109,7 +112,9 @@ func (s *ServiceManager) Command() *exec.Cmd { func (s *ServiceManager) Start() *exec.Cmd { log.Println("[DEBUG] starting service") cmd := exec.Command(s.Cmd, s.Args...) - cmd.Env = s.Env + env := os.Environ() + env = append(env, s.Env...) + cmd.Env = env cmdReader, err := cmd.StdoutPipe() if err != nil {