Merge pull request #719 from richardkmichael/fix-704-trim-command-whitespace
fix: Trim whitespace from Command input to prevent ENOENT
This commit is contained in:
commit
d48164aa09
3 changed files with 550 additions and 512 deletions
|
|
@ -268,6 +268,7 @@ const Sidebar = ({
|
||||||
placeholder="Command"
|
placeholder="Command"
|
||||||
value={command}
|
value={command}
|
||||||
onChange={(e) => setCommand(e.target.value)}
|
onChange={(e) => setCommand(e.target.value)}
|
||||||
|
onBlur={(e) => setCommand(e.target.value.trim())}
|
||||||
className="font-mono"
|
className="font-mono"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -181,7 +181,7 @@ const createTransport = async (req: express.Request): Promise<Transport> => {
|
||||||
const transportType = query.transportType as string;
|
const transportType = query.transportType as string;
|
||||||
|
|
||||||
if (transportType === "stdio") {
|
if (transportType === "stdio") {
|
||||||
const command = query.command as string;
|
const command = (query.command as string).trim();
|
||||||
const origArgs = shellParseArgs(query.args as string) as string[];
|
const origArgs = shellParseArgs(query.args as string) as string[];
|
||||||
const queryEnv = query.env ? JSON.parse(query.env as string) : {};
|
const queryEnv = query.env ? JSON.parse(query.env as string) : {};
|
||||||
const env = { ...defaultEnvironment, ...process.env, ...queryEnv };
|
const env = { ...defaultEnvironment, ...process.env, ...queryEnv };
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue