File tree 3 files changed +17
-9
lines changed
3 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ Default overwrite mode is set to "Overwrite All existing files without prompt" u
109
109
* ` data.method ` string
110
110
* ` data.solid ` string
111
111
* ` data.blocks ` number
112
+ * ` data.directories ` array (same as ` data.files ` )
112
113
* ` data.files ` array
113
114
114
115
* ` data.files[].attr ` string
Original file line number Diff line number Diff line change @@ -21,10 +21,11 @@ function ArchiveInfo() {
21
21
this . method = undefined ;
22
22
this . solid = undefined ;
23
23
this . blocks = undefined ;
24
+ this . directories = [ ] ;
24
25
this . files = [ ] ;
25
26
}
26
27
27
- function ArchiveFile ( ) {
28
+ function ArchiveEntry ( ) {
28
29
this . attr = undefined ;
29
30
this . compressed = undefined ;
30
31
this . date = undefined ;
@@ -54,13 +55,19 @@ module.exports = function (archive, switches) {
54
55
lines . forEach ( function ( line ) {
55
56
var res = regex . exec ( line ) ;
56
57
if ( res ) {
57
- var file = new ArchiveFile ( ) ;
58
- file . date = new Date ( res [ 1 ] ) ;
59
- file . attr = res [ 2 ] ;
60
- file . size = parseInt ( res [ 3 ] , 10 ) || 0 ;
61
- file . compressed = parseInt ( res [ 4 ] ) || 0 ;
62
- file . name = res [ 5 ] ;
63
- info . files . push ( file ) ;
58
+ var entry = new ArchiveEntry ( ) ;
59
+ entry . date = new Date ( res [ 1 ] ) ;
60
+ entry . attr = res [ 2 ] ;
61
+ entry . size = parseInt ( res [ 3 ] , 10 ) || 0 ;
62
+ entry . compressed = parseInt ( res [ 4 ] ) || 0 ;
63
+ entry . name = res [ 5 ] ;
64
+
65
+ if ( ~ ( entry . attr || '' ) . indexOf ( 'D' ) ) {
66
+ info . directories . push ( entry ) ;
67
+ } else {
68
+ info . files . push ( entry ) ;
69
+ }
70
+
64
71
} else {
65
72
properties . some ( function ( property ) {
66
73
if ( tools . start ( line , property + ' = ' ) ) {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " p7zip" ,
3
- "version" : " 2.0 .0" ,
3
+ "version" : " 2.1 .0" ,
4
4
"description" : " A node wrapper for 7z including latest version of 7za" ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
You can’t perform that action at this time.
0 commit comments