Skip to content

Commit d189e47

Browse files
Potential fix for code scanning alert no. 10: Shell command built from environment values
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent ee625e9 commit d189e47

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/buildScripts.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const fs = require("fs");
22
const path = require("path");
3-
const { execSync } = require("child_process");
3+
const { execSync, execFileSync } = require("child_process");
44

55
// Configuration file path
66
const CONFIG_FILE = path.join(__dirname, "build-config.json");
@@ -58,10 +58,10 @@ function runBuildScripts() {
5858
try {
5959
if (scriptPath.endsWith(".ts")) {
6060
// For TypeScript files, use ts-node
61-
execSync(`npx ts-node ${fullPath}`, { stdio: "inherit" });
61+
execFileSync("npx", ["ts-node", fullPath], { stdio: "inherit" });
6262
} else {
6363
// For JavaScript files, use node
64-
execSync(`node ${fullPath}`, { stdio: "inherit" });
64+
execFileSync("node", [fullPath], { stdio: "inherit" });
6565
}
6666
console.log(`✅ Completed: ${scriptPath}`);
6767
} catch (error) {

0 commit comments

Comments
 (0)