@getgauge/cli
Advanced tools
Comparing version
@@ -32,6 +32,5 @@ { | ||
"dependencies": { | ||
"superagent": "^5.2.2", | ||
"unzipper": "^0.9.3" | ||
}, | ||
"version": "1.1.1" | ||
"version": "1.1.2" | ||
} |
@@ -8,6 +8,15 @@ #!/usr/bin/env node | ||
unzip = require('unzipper'), | ||
request = require('superagent'), | ||
https = require('https'), | ||
packageJsonPath = path.join(__dirname, "..", "package.json"), | ||
binPath = "./bin"; | ||
var downloadFollowingRedirect = function(url, resolve, reject) { | ||
https.get(url, { headers: { 'accept-encoding': 'gzip,deflate' } }, res => { | ||
if (res.statusCode >= 300 && res.statusCode < 400) { | ||
downloadFollowingRedirect(res.headers.location, reject, resolve); | ||
} else { | ||
res.pipe(unzip.Extract({ path: path.normalize(binPath) })).on('error', reject).on('end', resolve); | ||
} | ||
}); | ||
}; | ||
@@ -20,4 +29,3 @@ var downloadAndExtract = function(version) { | ||
try { | ||
request.get(url).pipe(unzip.Extract({ path: path.normalize(binPath) })); | ||
resolve(); | ||
downloadFollowingRedirect(url, resolve, reject); | ||
} catch (error) { | ||
@@ -27,6 +35,6 @@ reject(error); | ||
}) | ||
} | ||
}; | ||
install.getVersion(packageJsonPath) | ||
.then((v) => downloadAndExtract(v.split('-')[0])) | ||
.catch((e) => console.error(e)); | ||
.then((v) => downloadAndExtract(v.split('-')[0])) | ||
.catch((e) => console.error(e)); |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
4449
8.8%1
-50%89
9.88%5
-16.67%1
Infinity%- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed