mirror of
https://github.com/wso2/open-mcp-auth-proxy.git
synced 2025-06-27 17:13:31 +00:00
Handle spawning subprocess within windows
This commit is contained in:
parent
ad5185ad72
commit
68015ae8fc
5 changed files with 167 additions and 52 deletions
|
@ -3,6 +3,8 @@ package config
|
|||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
@ -145,7 +147,16 @@ func (c *Config) BuildExecCommand() string {
|
|||
return ""
|
||||
}
|
||||
|
||||
// Construct the full command
|
||||
|
||||
if runtime.GOOS == "windows" {
|
||||
// For Windows, we need to properly escape the inner command
|
||||
escapedCommand := strings.ReplaceAll(c.Stdio.UserCommand, `"`, `\"`)
|
||||
return fmt.Sprintf(
|
||||
`npx -y supergateway --stdio "%s" --port %d --baseUrl %s --ssePath %s --messagePath %s`,
|
||||
escapedCommand, c.Port, c.BaseURL, c.Paths.SSE, c.Paths.Messages,
|
||||
)
|
||||
}
|
||||
|
||||
return fmt.Sprintf(
|
||||
`npx -y supergateway --stdio "%s" --port %d --baseUrl %s --ssePath %s --messagePath %s`,
|
||||
c.Stdio.UserCommand, c.Port, c.BaseURL, c.Paths.SSE, c.Paths.Messages,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue