()
| 51 | }); |
| 52 | } |
| 53 | function 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 | } |
no test coverage detected