mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Adapt per review
This commit is contained in:
parent
9dacf5cff3
commit
190607de92
27 changed files with 191 additions and 114 deletions
|
|
@ -2,35 +2,16 @@
|
|||
|
||||
import { main } from "../src/main.js";
|
||||
import { initializePackageManager } from "../src/packagemanager/currentPackageManager.js";
|
||||
import { setEcoSystem } from "../src/config/settings.js";
|
||||
import { setEcoSystem, ECOSYSTEM_PY } from "../src/config/settings.js";
|
||||
|
||||
// Defaults
|
||||
let packageManagerName = "pip";
|
||||
let targetVersionMajor;
|
||||
|
||||
// Copy argv so we can modify it
|
||||
// Pass through user args as-is
|
||||
const argv = process.argv.slice(2);
|
||||
|
||||
for (let i = 0; i < argv.length; i++) {
|
||||
const a = argv[i];
|
||||
|
||||
// --target-version-major tells us which pip version is being used (2 or 3)
|
||||
if (a === "--target-version-major" && i + 1 < argv.length) {
|
||||
targetVersionMajor = argv[i + 1];
|
||||
argv.splice(i, 2);
|
||||
i -= 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// If the user explicitly called python3, prefer pip3
|
||||
if (targetVersionMajor && String(targetVersionMajor).trim() === "3") {
|
||||
packageManagerName = "pip3";
|
||||
}
|
||||
|
||||
// Set eco system
|
||||
// This can be used in other parts of the code to determine which eco system we are working with
|
||||
setEcoSystem("py");
|
||||
setEcoSystem(ECOSYSTEM_PY);
|
||||
|
||||
initializePackageManager(packageManagerName);
|
||||
const exitCode = await main(argv);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue