This commit is contained in:
Reinier Criel 2025-10-21 15:25:12 -07:00
parent 6a69eec342
commit d0f2edec0a
5 changed files with 60 additions and 22 deletions

33
package-lock.json generated
View file

@ -154,8 +154,7 @@
"optional": true, "optional": true,
"os": [ "os": [
"darwin" "darwin"
], ]
"peer": true
}, },
"node_modules/@oven/bun-darwin-x64": { "node_modules/@oven/bun-darwin-x64": {
"version": "1.2.21", "version": "1.2.21",
@ -168,8 +167,7 @@
"optional": true, "optional": true,
"os": [ "os": [
"darwin" "darwin"
], ]
"peer": true
}, },
"node_modules/@oven/bun-darwin-x64-baseline": { "node_modules/@oven/bun-darwin-x64-baseline": {
"version": "1.2.21", "version": "1.2.21",
@ -182,8 +180,7 @@
"optional": true, "optional": true,
"os": [ "os": [
"darwin" "darwin"
], ]
"peer": true
}, },
"node_modules/@oven/bun-linux-aarch64": { "node_modules/@oven/bun-linux-aarch64": {
"version": "1.2.21", "version": "1.2.21",
@ -196,8 +193,7 @@
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
], ]
"peer": true
}, },
"node_modules/@oven/bun-linux-aarch64-musl": { "node_modules/@oven/bun-linux-aarch64-musl": {
"version": "1.2.21", "version": "1.2.21",
@ -210,8 +206,7 @@
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
], ]
"peer": true
}, },
"node_modules/@oven/bun-linux-x64": { "node_modules/@oven/bun-linux-x64": {
"version": "1.2.21", "version": "1.2.21",
@ -224,8 +219,7 @@
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
], ]
"peer": true
}, },
"node_modules/@oven/bun-linux-x64-baseline": { "node_modules/@oven/bun-linux-x64-baseline": {
"version": "1.2.21", "version": "1.2.21",
@ -238,8 +232,7 @@
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
], ]
"peer": true
}, },
"node_modules/@oven/bun-linux-x64-musl": { "node_modules/@oven/bun-linux-x64-musl": {
"version": "1.2.21", "version": "1.2.21",
@ -252,8 +245,7 @@
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
], ]
"peer": true
}, },
"node_modules/@oven/bun-linux-x64-musl-baseline": { "node_modules/@oven/bun-linux-x64-musl-baseline": {
"version": "1.2.21", "version": "1.2.21",
@ -266,8 +258,7 @@
"optional": true, "optional": true,
"os": [ "os": [
"linux" "linux"
], ]
"peer": true
}, },
"node_modules/@oven/bun-windows-x64": { "node_modules/@oven/bun-windows-x64": {
"version": "1.2.21", "version": "1.2.21",
@ -280,8 +271,7 @@
"optional": true, "optional": true,
"os": [ "os": [
"win32" "win32"
], ]
"peer": true
}, },
"node_modules/@oven/bun-windows-x64-baseline": { "node_modules/@oven/bun-windows-x64-baseline": {
"version": "1.2.21", "version": "1.2.21",
@ -294,8 +284,7 @@
"optional": true, "optional": true,
"os": [ "os": [
"win32" "win32"
], ]
"peer": true
}, },
"node_modules/@oxlint/darwin-arm64": { "node_modules/@oxlint/darwin-arm64": {
"version": "1.22.0", "version": "1.22.0",

View file

@ -0,0 +1,9 @@
#!/usr/bin/env node
import { main } from "../src/main.js";
import { initializePackageManager } from "../src/packagemanager/currentPackageManager.js";
const packageManagerName = "pip";
initializePackageManager(packageManagerName);
var exitCode = await main(process.argv.slice(2));
process.exit(exitCode);

View file

@ -14,6 +14,7 @@
"aikido-pnpx": "bin/aikido-pnpx.js", "aikido-pnpx": "bin/aikido-pnpx.js",
"aikido-bun": "bin/aikido-bun.js", "aikido-bun": "bin/aikido-bun.js",
"aikido-bunx": "bin/aikido-bunx.js", "aikido-bunx": "bin/aikido-bunx.js",
"aikido-pip": "bin/aikido-pip.js",
"safe-chain": "bin/safe-chain.js" "safe-chain": "bin/safe-chain.js"
}, },
"type": "module", "type": "module",

View file

@ -0,0 +1,31 @@
import { ui } from "../../environment/userInteraction.js";
import { safeSpawn } from "../../utils/safeSpawn.js";
import { mergeSafeChainProxyEnvironmentVariables } from "../../registryProxy/registryProxy.js";
export function createPipPackageManager() {
return {
runCommand: (args) => runPipCommand("pip3", args),
// For pip, set proxy server
isSupportedCommand: () => false,
getDependencyUpdatesForCommand: () => [],
};
}
async function runPipCommand(command, args) {
try {
console.log("**createPipPackageManager.js** Running pip command");
const result = await safeSpawn(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 };
}
}
}

View file

@ -50,6 +50,14 @@ function bunx() {
wrapSafeChainCommand "bunx" "aikido-bunx" "$@" wrapSafeChainCommand "bunx" "aikido-bunx" "$@"
} }
function pip() {
wrapSafeChainCommand "pip" "aikido-pip" "$@"
}
function pip3() {
wrapSafeChainCommand "pip3" "aikido-pip" "$@"
}
function npm() { function npm() {
if [[ "$1" == "-v" || "$1" == "--version" ]] && [[ $# -eq 1 ]]; then if [[ "$1" == "-v" || "$1" == "--version" ]] && [[ $# -eq 1 ]]; then
# If args is just -v or --version and nothing else, just run the npm version command # If args is just -v or --version and nothing else, just run the npm version command