fix: use spread operator to avoid empty string arguments

This fixes the regression introduced in dc5fa6a where empty strings
were passed as arguments when no command or args were provided,
causing parseArgs to fail with "Unexpected argument ''" error.

The spread operator approach is more idiomatic and avoids creating
empty strings that need to be filtered out.
This commit is contained in:
Felix Weinberger 2025-08-05 11:50:06 +01:00
commit de16a18e2f
No known key found for this signature in database

View file

@ -91,10 +91,10 @@ async function startProdServer(serverOptions) {
"node",
[
inspectorServerPath,
command ? `--command=${command}` : "",
mcpServerArgs && mcpServerArgs.length > 0
? `--args=${mcpServerArgs.join(" ")}`
: "",
...(command ? [`--command=${command}`] : []),
...(mcpServerArgs && mcpServerArgs.length > 0
? [`--args=${mcpServerArgs.join(" ")}`]
: []),
],
{
env: {