Some cleanup

This commit is contained in:
Reinier Criel 2025-11-06 13:24:00 -08:00
parent 2632b5c2af
commit 61a53b24fd
7 changed files with 4 additions and 7 deletions

View file

@ -1,6 +1,5 @@
#!/usr/bin/env node
import { main } from "../src/main.js";
import { initializePackageManager } from "../src/packagemanager/currentPackageManager.js";
import { setEcoSystem, ECOSYSTEM_PY } from "../src/config/settings.js";

View file

@ -1,4 +1,3 @@
// Constant for pip package manager name
export const PIP_PACKAGE_MANAGER = "pip";
// Enum of possible Python/pip invocations for Safe Chain interception

View file

@ -26,11 +26,11 @@ export async function runPip(command, args) {
});
return { status: result.status };
} catch (/** @type any */ error) {
ui.writeError(`Error executing command: ${error.message}`);
ui.writeError(`Is '${command}' installed and available on your system?`);
if (error.status) {
return { status: error.status };
} else {
ui.writeError(`Error executing command: ${error.message}`);
ui.writeError(`Is '${command}' installed and available on your system?`);
return { status: 1 };
}
}

View file

@ -145,6 +145,7 @@ function handleConnect(req, clientSocket, head) {
if (isKnownRegistry) {
mitmConnect(req, clientSocket, isAllowedUrl);
} else {
// For other hosts, just tunnel the request to the destination tcp socket
ui.writeVerbose(`Safe-chain: Tunneling request to ${req.url}`);
tunnelRequest(req, clientSocket, head);
}

View file

@ -71,8 +71,6 @@ function createUnixShims(shimsDir) {
);
}
/**
* @param {string} shimsDir
*

View file

@ -21,6 +21,7 @@ function wrapSafeChainCommand() {
else
# If the aikido command is not available, print a warning and run the original command
printSafeChainWarning "$original_cmd"
command "$original_cmd" "$@"
fi
}

View file

@ -50,7 +50,6 @@ RUN volta install pnpm@${PNPM_VERSION}
# Install Bun
RUN curl -fsSL https://bun.sh/install | bash
# Install Python and pip (pip3)
RUN apt-get update && apt-get install -y python${PYTHON_VERSION} python3-pip && \
ln -sf /usr/bin/python${PYTHON_VERSION} /usr/local/bin/python3 && \