diff --git a/index.js b/index.js index 8c193e4..8151143 100644 --- a/index.js +++ b/index.js @@ -32,6 +32,13 @@ module.exports = function (zipPath, opts, cb) { var cancelled = false + zipfile.on('error', function (err) { + if (err) { + cancelled = true + return cb(err) + } + }) + zipfile.readEntry() zipfile.on('close', function () { diff --git a/package.json b/package.json index 65afd96..81253c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "extract-zip", - "version": "1.6.7", + "name": "@vtex/extract-zip", + "version": "1.7.0", "description": "unzip a zip file into a directory using 100% javascript", "main": "index.js", "bin": { diff --git a/readme.md b/readme.md index af17885..a0ec4ff 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,7 @@ +# Fork motivation + +We forked this project in order to solve an error handling issue that was pending for several months in the original project. See [this PR in `builder-hub`](https://github.com/vtex/builder-hub/pull/216) for context. + # extract-zip Unzip written in pure JavaScript. Extracts a zip into a directory. Available as a library or a command line program.