Skip to content
This repository was archived by the owner on Jul 24, 2019. It is now read-only.

Commit 77460b6

Browse files
committedMar 17, 2016
Replace adm_zip install dependency with extract-zip due to licensing issues with the former.
1 parent 9668e8c commit 77460b6

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed
 

‎install.js

+9-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
var requestProgress = require('request-progress')
1010
var progress = require('progress')
11-
var AdmZip = require('adm-zip')
11+
var ExtractZip = require('extract-zip')
1212
var cp = require('child_process')
1313
var fs = require('fs-extra')
1414
var hasha = require('hasha')
@@ -285,15 +285,14 @@ function extractDownload(filePath) {
285285

286286
if (filePath.substr(-4) === '.zip') {
287287
console.log('Extracting zip contents')
288-
289-
try {
290-
var zip = new AdmZip(filePath)
291-
zip.extractAllTo(extractedPath, true)
292-
deferred.resolve(extractedPath)
293-
} catch (err) {
294-
console.error('Error extracting zip')
295-
deferred.reject(err)
296-
}
288+
ExtractZip(path.resolve(filePath), {dir: extractedPath}, function(err) {
289+
if (err) {
290+
console.error('Error extracting zip')
291+
deferred.reject(err)
292+
} else {
293+
deferred.resolve(extractedPath)
294+
}
295+
})
297296

298297
} else {
299298
console.log('Extracting tar contents (via spawned process)')

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535
"phantomjs": "./bin/phantomjs"
3636
},
3737
"scripts": {
38-
"install": "node install.js",
38+
"install": "node --debug-brk install.js",
3939
"test": "nodeunit --reporter=minimal test/tests.js && eslint install.js"
4040
},
4141
"dependencies": {
42-
"adm-zip": "~0.4.7",
42+
"extract-zip": "~1.5.0",
4343
"fs-extra": "~0.26.4",
4444
"hasha": "^2.2.0",
4545
"kew": "~0.7.0",

0 commit comments

Comments
 (0)
This repository has been archived.