MCPcopy Index your code
hub / github.com/remoteinterview/zero / getPipExe

Function getPipExe

packages/handler-python/installPip.js:35–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

33};
34
35function getPipExe() {
36 const pip =
37 which.sync("pip3", { nothrow: true }) ||
38 which.sync("pip", { nothrow: true });
39 if (pip) {
40 return pip;
41 }
42
43 // try python -m pip
44 const pythonExe = getPythonExe();
45 return new Promise((resolve, reject) => {
46 var child = spawn(pythonExe, ["-m", "pip"]);
47 child.on("close", code => {
48 if (code === 0) resolve([pythonExe, "-m", "pip"]);
49 else resolve();
50 });
51 });
52}
53function getPipInstaller() {
54 // install pip
55 return new Promise((resolve, reject) => {

Callers 1

installPip.jsFile · 0.85

Calls 2

resolveFunction · 0.85
onMethod · 0.45

Tested by

no test coverage detected