mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Fix args
This commit is contained in:
parent
9bd29056c6
commit
032fc3847f
3 changed files with 5 additions and 5 deletions
|
|
@ -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 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')) {
|
if (argv[0] === '-m' && (argv[1] === 'pip' || argv[1] === 'pip3')) {
|
||||||
setEcoSystem(ECOSYSTEM_PY);
|
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);
|
initializePackageManager(PIP_PACKAGE_MANAGER);
|
||||||
argv = argv.slice(2);
|
argv = argv.slice(2);
|
||||||
var exitCode = await main(argv);
|
var exitCode = await main(argv);
|
||||||
|
|
|
||||||
|
|
@ -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 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')) {
|
if (argv[0] === '-m' && (argv[1] === 'pip' || argv[1] === 'pip3')) {
|
||||||
setEcoSystem(ECOSYSTEM_PY);
|
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);
|
initializePackageManager(PIP_PACKAGE_MANAGER);
|
||||||
argv = argv.slice(2);
|
argv = argv.slice(2);
|
||||||
var exitCode = await main(argv);
|
var exitCode = await main(argv);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,9 @@ export const PIP_INVOCATIONS = {
|
||||||
PIP: { command: "pip", args: [] },
|
PIP: { command: "pip", args: [] },
|
||||||
PIP3: { command: "pip3", args: [] },
|
PIP3: { command: "pip3", args: [] },
|
||||||
PY_PIP: { command: "python", args: ["-m", "pip"] },
|
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
|
* @param {{ command: string, args: string[] }} invocation
|
||||||
*/
|
*/
|
||||||
export function setCurrentPipInvocation(invocation) {
|
export function setCurrentPipInvocation(invocation) {
|
||||||
console.debug('[safe-chain debug] setCurrentPipInvocation:', invocation);
|
|
||||||
currentInvocation = invocation;
|
currentInvocation = invocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -26,6 +27,5 @@ export function setCurrentPipInvocation(invocation) {
|
||||||
* @returns {{ command: string, args: string[] }}
|
* @returns {{ command: string, args: string[] }}
|
||||||
*/
|
*/
|
||||||
export function getCurrentPipInvocation() {
|
export function getCurrentPipInvocation() {
|
||||||
console.debug('[safe-chain debug] getCurrentPipInvocation:', currentInvocation);
|
|
||||||
return currentInvocation;
|
return currentInvocation;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue