mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
21 lines
654 B
JavaScript
21 lines
654 B
JavaScript
import { ui } from "../../environment/userInteraction.js";
|
|
import { safeSpawnPy } from "../../utils/safeSpawn.js";
|
|
import { mergeSafeChainProxyEnvironmentVariables } from "../../registryProxy/registryProxy.js";
|
|
|
|
|
|
export async function runPip(command, args) {
|
|
try {
|
|
const result = await safeSpawnPy(command, args, {
|
|
stdio: "inherit",
|
|
env: mergeSafeChainProxyEnvironmentVariables(process.env),
|
|
});
|
|
return { status: result.status };
|
|
} catch (error) {
|
|
if (error.status) {
|
|
return { status: error.status };
|
|
} else {
|
|
ui.writeError("Error executing command:", error.message);
|
|
return { status: 1 };
|
|
}
|
|
}
|
|
}
|