File tree 1 file changed +9
-6
lines changed
1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ class PackDir {
14
14
dmg : / d a r w i n / ,
15
15
dmgFormat : 'UDZO' ,
16
16
isSilent : false ,
17
- isSync : true
17
+ isSync : true ,
18
+ skipDirName : true
18
19
} ;
19
20
20
21
this . DMG = '.dmg' ;
@@ -191,11 +192,7 @@ class PackDir {
191
192
let fileName = path + this . ZIP ,
192
193
pathInfo = Path . parse ( path ) ,
193
194
pathStat = FS . statSync ( path ) ,
194
- pathWithMask = (
195
- pathStat . isDirectory ( )
196
- ? ( pathInfo . base + Path . sep + '*' )
197
- : pathInfo . base
198
- ) ,
195
+ pathWithMask = pathInfo . base ,
199
196
pathToZipFile = pathInfo . base + '.zip' ,
200
197
params = { } ;
201
198
@@ -205,6 +202,12 @@ class PackDir {
205
202
206
203
this . cleanFile ( fileName ) ;
207
204
205
+ if ( this . params . skipDirName && pathStat . isDirectory ( ) ) {
206
+ params . cwd = path ;
207
+ pathWithMask = '*' ;
208
+ pathToZipFile = Path . join ( '..' , pathToZipFile ) ;
209
+ }
210
+
208
211
let args = [
209
212
'-r' ,
210
213
this . escapeArg ( pathToZipFile ) ,
You can’t perform that action at this time.
0 commit comments