From 8efb27eede6762a105771eee9593cebc5d949dd1 Mon Sep 17 00:00:00 2001 From: anupamme Date: Thu, 8 Oct 2026 21:16:12 +0000 Subject: [PATCH] fix: multi_agent.cwe-78 security vulnerability Automated security fix generated by OrbisAI Security --- scripts/foreach-example.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/foreach-example.ts b/scripts/foreach-example.ts index ea425de..3a529c5 100644 --- a/scripts/foreach-example.ts +++ b/scripts/foreach-example.ts @@ -1,4 +1,4 @@ -import { execSync } from 'child_process'; +import { execFileSync } from 'child_process'; import * as fs from 'fs'; import * as path from 'path'; import * as semver from 'semver'; @@ -11,7 +11,7 @@ function nodeReq(dir: string): string | undefined { ).engines?.node; } -const cmd = process.argv.slice(2).join(' '); +const [cmd, ...cmdArgs] = process.argv.slice(2); const root = path.join(__dirname, '..'); const examples = path.join(root, 'examples'); @@ -22,8 +22,10 @@ const dirs = fs .filter((dir) => semver.satisfies(process.version, nodeReq(dir) || '>=16')); for (const dir of dirs) { - console.log(`\x1b[97m> \x1b[37m${cmd} \x1b[90m<== \x1b[36m${dir}\x1b[0m`); - execSync(cmd, { + console.log( + `\x1b[97m> \x1b[37m${[cmd, ...cmdArgs].join(' ')} \x1b[90m<== \x1b[36m${dir}\x1b[0m`, + ); + execFileSync(cmd, cmdArgs, { stdio: 'inherit', cwd: path.join(root, dir), });