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

Function getPipInstaller

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

Source from the content-addressed store, hash-verified

51 });
52}
53function getPipInstaller() {
54 // install pip
55 return new Promise((resolve, reject) => {
56 const pipFilePath = path.join(__dirname, "get-pip.py");
57 if (fs.existsSync(pipFilePath)) return resolve(pipFilePath);
58
59 const file = fs.createWriteStream(pipFilePath);
60 const request = https.get(pipUrl, function(response) {
61 response.pipe(file);
62 file.on("finish", function() {
63 file.close(() => {
64 resolve(pipFilePath);
65 });
66 });
67 file.on("error", function(err) {
68 fs.unlink(pipFilePath);
69 reject(err);
70 });
71 });
72 });
73}

Callers 1

installPip.jsFile · 0.85

Calls 2

resolveFunction · 0.85
onMethod · 0.45

Tested by

no test coverage detected