AikidoSec-safe-chain/packages/safe-chain/src/packagemanager/npx/runNpxCommand.js
2025-09-05 11:19:37 +02:00

17 lines
461 B
JavaScript

import { execSync } from "child_process";
import { ui } from "../../environment/userInteraction.js";
export function runNpx(args) {
try {
const npxCommand = `npx ${args.join(" ")}`;
execSync(npxCommand, { stdio: "inherit" });
} catch (error) {
if (error.status) {
return { status: error.status };
} else {
ui.writeError("Error executing command:", error.message);
return { status: 1 };
}
}
return { status: 0 };
}