mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Fix warnings
This commit is contained in:
parent
548d416996
commit
27ca2153b0
1 changed files with 9 additions and 4 deletions
|
|
@ -3,9 +3,13 @@ import { safeSpawn } from "../../utils/safeSpawn.js";
|
||||||
import { mergeSafeChainProxyEnvironmentVariables } from "../../registryProxy/registryProxy.js";
|
import { mergeSafeChainProxyEnvironmentVariables } from "../../registryProxy/registryProxy.js";
|
||||||
import { getCombinedCaBundlePath } from "../../registryProxy/certBundle.js";
|
import { getCombinedCaBundlePath } from "../../registryProxy/certBundle.js";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} command
|
||||||
|
* @param {string[]} args
|
||||||
|
*/
|
||||||
export async function runPip(command, args) {
|
export async function runPip(command, args) {
|
||||||
try {
|
try {
|
||||||
const env = mergeSafeChainProxyEnvironmentVariables(process.env);
|
const env = mergeSafeChainProxyEnvironmentVariables(/** @type {Record<string, string>} */ (process.env));
|
||||||
|
|
||||||
// Always provide Python with a complete CA bundle (Safe Chain CA + Mozilla + Node built-in roots)
|
// Always provide Python with a complete CA bundle (Safe Chain CA + Mozilla + Node built-in roots)
|
||||||
// so that any network request made by pip, including those outside explicit CLI args,
|
// so that any network request made by pip, including those outside explicit CLI args,
|
||||||
|
|
@ -20,10 +24,11 @@ export async function runPip(command, args) {
|
||||||
});
|
});
|
||||||
return { status: result.status };
|
return { status: result.status };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.status) {
|
if (error && typeof error === "object" && "status" in error) {
|
||||||
return { status: error.status };
|
return { status: /** @type {any} */ (error).status };
|
||||||
} else {
|
} else {
|
||||||
ui.writeError("Error executing command:", error.message);
|
const message = error && typeof error === "object" && "message" in error ? /** @type {any} */ (error).message : String(error);
|
||||||
|
ui.writeError("Error executing command:", message);
|
||||||
return { status: 1 };
|
return { status: 1 };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue