This commit is contained in:
Reinier Criel 2025-11-06 11:09:28 -08:00
parent 9bd29056c6
commit 032fc3847f
3 changed files with 5 additions and 5 deletions

View file

@ -13,7 +13,7 @@ let argv = process.argv.slice(2);
// If no args are passed, argv[0] and argv[1] are undefined, so this condition just evaluates to false and does not throw.
if (argv[0] === '-m' && (argv[1] === 'pip' || argv[1] === 'pip3')) {
setEcoSystem(ECOSYSTEM_PY);
setCurrentPipInvocation(argv[1] === 'pip3' ? PIP_INVOCATIONS.PY3_PIP : PIP_INVOCATIONS.PY_PIP);
setCurrentPipInvocation(argv[1] === 'pip3' ? PIP_INVOCATIONS.PY_PIP3 : PIP_INVOCATIONS.PY_PIP);
initializePackageManager(PIP_PACKAGE_MANAGER);
argv = argv.slice(2);
var exitCode = await main(argv);

View file

@ -13,7 +13,7 @@ let argv = process.argv.slice(2);
// If no args are passed, argv[0] and argv[1] are undefined, so this condition just evaluates to false and does not throw.
if (argv[0] === '-m' && (argv[1] === 'pip' || argv[1] === 'pip3')) {
setEcoSystem(ECOSYSTEM_PY);
setCurrentPipInvocation(argv[1] === 'pip3' ? PIP_INVOCATIONS.PY3_PIP : PIP_INVOCATIONS.PY_PIP);
setCurrentPipInvocation(argv[1] === 'pip3' ? PIP_INVOCATIONS.PY3_PIP3 : PIP_INVOCATIONS.PY3_PIP);
initializePackageManager(PIP_PACKAGE_MANAGER);
argv = argv.slice(2);
var exitCode = await main(argv);

View file

@ -6,7 +6,9 @@ export const PIP_INVOCATIONS = {
PIP: { command: "pip", args: [] },
PIP3: { command: "pip3", args: [] },
PY_PIP: { command: "python", args: ["-m", "pip"] },
PY3_PIP: { command: "python3", args: ["-m", "pip"] }
PY3_PIP: { command: "python3", args: ["-m", "pip"] },
PY_PIP3: { command: "python", args: ["-m", "pip3"] },
PY3_PIP3: { command: "python3", args: ["-m", "pip3"] }
};
/**
@ -18,7 +20,6 @@ let currentInvocation = PIP_INVOCATIONS.PY3_PIP; // Default to python3 -m pip
* @param {{ command: string, args: string[] }} invocation
*/
export function setCurrentPipInvocation(invocation) {
console.debug('[safe-chain debug] setCurrentPipInvocation:', invocation);
currentInvocation = invocation;
}
@ -26,6 +27,5 @@ export function setCurrentPipInvocation(invocation) {
* @returns {{ command: string, args: string[] }}
*/
export function getCurrentPipInvocation() {
console.debug('[safe-chain debug] getCurrentPipInvocation:', currentInvocation);
return currentInvocation;
}