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

Commit

Permalink
Merge pull request #497 from bleggett/remove-adm-zip
Browse files Browse the repository at this point in the history
Replace adm_zip install dependency with extract-zip
  • Loading branch information
nicks committed Mar 18, 2016
2 parents 9668e8c + b3c688d commit 628ed57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
19 changes: 9 additions & 10 deletions install.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

var requestProgress = require('request-progress')
var progress = require('progress')
var AdmZip = require('adm-zip')
var extractZip = require('extract-zip')
var cp = require('child_process')
var fs = require('fs-extra')
var hasha = require('hasha')
Expand Down Expand Up @@ -285,15 +285,14 @@ function extractDownload(filePath) {

if (filePath.substr(-4) === '.zip') {
console.log('Extracting zip contents')

try {
var zip = new AdmZip(filePath)
zip.extractAllTo(extractedPath, true)
deferred.resolve(extractedPath)
} catch (err) {
console.error('Error extracting zip')
deferred.reject(err)
}
extractZip(path.resolve(filePath), {dir: extractedPath}, function(err) {
if (err) {
console.error('Error extracting zip')
deferred.reject(err)
} else {
deferred.resolve(extractedPath)
}
})

} else {
console.log('Extracting tar contents (via spawned process)')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"test": "nodeunit --reporter=minimal test/tests.js && eslint install.js"
},
"dependencies": {
"adm-zip": "~0.4.7",
"extract-zip": "~1.5.0",
"fs-extra": "~0.26.4",
"hasha": "^2.2.0",
"kew": "~0.7.0",
Expand Down

0 comments on commit 628ed57

Please sign in to comment.