mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
More cleanup
This commit is contained in:
parent
01cc0b06c0
commit
d3a4f81b3c
3 changed files with 12 additions and 6 deletions
|
|
@ -10,12 +10,15 @@ setEcoSystem(ECOSYSTEM_PY);
|
||||||
|
|
||||||
// Strip nodejs and wrapper script from args
|
// Strip nodejs and wrapper script from args
|
||||||
let argv = process.argv.slice(2);
|
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')) {
|
if (argv[0] === '-m' && (argv[1] === 'pip' || argv[1] === 'pip3')) {
|
||||||
setEcoSystem(ECOSYSTEM_PY);
|
setEcoSystem(ECOSYSTEM_PY);
|
||||||
setCurrentPipInvocation(argv[1] === 'pip3' ? PIP_INVOCATIONS.PY_PIP3 : PIP_INVOCATIONS.PY_PIP);
|
setCurrentPipInvocation(argv[1] === 'pip3' ? PIP_INVOCATIONS.PY_PIP3 : PIP_INVOCATIONS.PY_PIP);
|
||||||
initializePackageManager(PIP_PACKAGE_MANAGER);
|
initializePackageManager(PIP_PACKAGE_MANAGER);
|
||||||
|
|
||||||
|
// Strip off the '-m pip' or '-m pip3' from the args
|
||||||
argv = argv.slice(2);
|
argv = argv.slice(2);
|
||||||
|
|
||||||
var exitCode = await main(argv);
|
var exitCode = await main(argv);
|
||||||
process.exit(exitCode);
|
process.exit(exitCode);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,15 @@ setEcoSystem(ECOSYSTEM_PY);
|
||||||
|
|
||||||
// Strip nodejs and wrapper script from args
|
// Strip nodejs and wrapper script from args
|
||||||
let argv = process.argv.slice(2);
|
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')) {
|
if (argv[0] === '-m' && (argv[1] === 'pip' || argv[1] === 'pip3')) {
|
||||||
setEcoSystem(ECOSYSTEM_PY);
|
setEcoSystem(ECOSYSTEM_PY);
|
||||||
setCurrentPipInvocation(argv[1] === 'pip3' ? PIP_INVOCATIONS.PY3_PIP3 : PIP_INVOCATIONS.PY3_PIP);
|
setCurrentPipInvocation(argv[1] === 'pip3' ? PIP_INVOCATIONS.PY3_PIP3 : PIP_INVOCATIONS.PY3_PIP);
|
||||||
initializePackageManager(PIP_PACKAGE_MANAGER);
|
initializePackageManager(PIP_PACKAGE_MANAGER);
|
||||||
|
|
||||||
|
// Strip off the '-m pip' or '-m pip3' from the args
|
||||||
argv = argv.slice(2);
|
argv = argv.slice(2);
|
||||||
|
|
||||||
var exitCode = await main(argv);
|
var exitCode = await main(argv);
|
||||||
process.exit(exitCode);
|
process.exit(exitCode);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
export const PIP_PACKAGE_MANAGER = "pip";
|
export const PIP_PACKAGE_MANAGER = "pip";
|
||||||
|
|
||||||
// Enum of possible Python/pip invocations for Safe Chain interception
|
// All supported python/pip invocations for Safe Chain interception
|
||||||
export const PIP_INVOCATIONS = {
|
export const PIP_INVOCATIONS = {
|
||||||
PIP: { command: "pip", args: [] },
|
PIP: { command: "pip", args: [] },
|
||||||
PIP3: { command: "pip3", args: [] },
|
PIP3: { command: "pip3", args: [] },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue