| 53 | } |
| 54 | |
| 55 | function retrieveRemote(url, dest, cb) { |
| 56 | Common.logMod(`Retrieving remote package ${url}...`) |
| 57 | |
| 58 | var wget = spawn('wget', [url, '-O', dest, '-q'], { |
| 59 | stdio : 'inherit', |
| 60 | env: process.env, |
| 61 | windowsHide: true |
| 62 | }) |
| 63 | |
| 64 | wget.on('error', (err) => { |
| 65 | console.error(err.stack || err) |
| 66 | }) |
| 67 | |
| 68 | wget.on('close', (code) => { |
| 69 | if (code !== 0) |
| 70 | return cb(new Error('Could not download')) |
| 71 | return cb(null) |
| 72 | }) |
| 73 | } |
| 74 | |
| 75 | function installLocal(PM2, module_filepath, opts, cb) { |
| 76 | Common.logMod(`Installing package ${module_filepath}`) |