File tree 5 files changed +23
-0
lines changed
5 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,11 @@ module.exports = function centralDirectory(source, options) {
141
141
vars . offsetToStartOfCentralDirectory += startOffset ;
142
142
}
143
143
} )
144
+ . then ( function ( ) {
145
+ return endDir . pull ( vars . commentLength ) . then ( function ( comment ) {
146
+ vars . comment = comment . toString ( 'utf8' ) ;
147
+ } ) ;
148
+ } )
144
149
. then ( function ( ) {
145
150
source . stream ( vars . offsetToStartOfCentralDirectory ) . pipe ( records ) ;
146
151
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ var test = require ( 'tap' ) . test ;
4
+ var path = require ( 'path' ) ;
5
+ var unzip = require ( '../' ) ;
6
+
7
+
8
+ test ( "get comment out of a zip" , function ( t ) {
9
+ var archive = path . join ( __dirname , '../testData/compressed-comment/archive.zip' ) ;
10
+
11
+ unzip . Open . file ( archive )
12
+ . then ( function ( d ) {
13
+ t . equal ( 'Zipfile has a comment' , d . comment ) ;
14
+ t . end ( ) ;
15
+ } ) ;
16
+ } ) ;
Original file line number Diff line number Diff line change
1
+ 42
Original file line number Diff line number Diff line change
1
+ node.js rocks
You can’t perform that action at this time.
0 commit comments