mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-09-21 09:28:14 +00:00
fix: merge os.Environ() with custom env in NewStdioTransport
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
"sync"
|
||||
)
|
||||
@ -22,7 +23,7 @@ type StdioTransport struct {
|
||||
func NewStdioTransport(command string, args []string, env []string) (*StdioTransport, error) {
|
||||
cmd := exec.Command(command, args...)
|
||||
if len(env) > 0 {
|
||||
cmd.Env = env
|
||||
cmd.Env = append(os.Environ(), env...)
|
||||
}
|
||||
|
||||
stdin, err := cmd.StdinPipe()
|
||||
|
||||
Reference in New Issue
Block a user