Potential fix for code scanning alert no. 5: Shell command built from environment values

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: Geoff Seemueller <28698553+geoffsee@users.noreply.github.com>
This commit is contained in:
Geoff Seemueller
2025-07-17 13:46:23 -04:00
parent 734f48d4a7
commit 4edee1e191

View File

@@ -1,4 +1,4 @@
import { execSync } from 'node:child_process';
import { execSync, execFileSync } from 'node:child_process';
import {
existsSync,
readdirSync,
@@ -175,7 +175,7 @@ function optimizeWasmSize() {
if (sizeInMb > 30) {
logger.info(`WASM size is ${sizeInMb.toFixed(2)}MB, optimizing...`);
execSync(`wasm-opt -Oz -o ${wasmPath} ${wasmPath}`, {
execFileSync('wasm-opt', ['-Oz', '-o', wasmPath, wasmPath], {
encoding: 'utf-8',
});
logger.info(`✅ WASM size optimized`);