max-mapper / extract-zip

Zip extraction written in pure JavaScript. Extracts a zip into a directory.
BSD 2-Clause "Simplified" License
388 stars 126 forks source link

Callback called multiple times #18

Closed stefanjudis closed 8 years ago

stefanjudis commented 8 years ago

I am using the electron-packager module and stumbled into the case that the callback of extract-zip is called multiple time in error case.

The bug is reproducible here https://github.com/stefanjudis/extract-zip-bug-example.

These lines

'use strict';

var extract = require( 'extract-zip' );

extract( __dirname + '/electron-v0.36.2-darwin-x64.zip', { dir : __dirname + '/dist' }, function( error ) {
  console.log( 'Calling with error :' + error );
} );

lead to this output

stefan @ stefan-mac: ~/Sites/extract-zip-bug-example master ヾ(⌐■_■)ノ
> node index.js
39340031
Calling with error :Error: EEXIST: file already exists, symlink 'Versions/Current/Electron Framework' -> '/Users/stefan/Sites/extract-zip-bug-example/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Electron Framework'
39340031
Calling with error :undefined

stefan @ stefan-mac: ~/Sites/extract-zip-bug-example master ヾ(⌐■_■)ノ
> node --version
v5.0.0