Skip to content

Commit e799d00

Browse files
authored
Merge pull request #8 from aynurin/skipDirName_parameter
Added `skipDirName` param
2 parents 821f785 + 7caa01c commit e799d00

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

index.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ class PackDir {
1414
dmg: /darwin/,
1515
dmgFormat: 'UDZO',
1616
isSilent: false,
17-
isSync: true
17+
isSync: true,
18+
skipDirName: true
1819
};
1920

2021
this.DMG = '.dmg';
@@ -191,11 +192,7 @@ class PackDir {
191192
let fileName = path + this.ZIP,
192193
pathInfo = Path.parse(path),
193194
pathStat = FS.statSync(path),
194-
pathWithMask = (
195-
pathStat.isDirectory()
196-
? (pathInfo.base + Path.sep + '*')
197-
: pathInfo.base
198-
),
195+
pathWithMask = pathInfo.base,
199196
pathToZipFile = pathInfo.base + '.zip',
200197
params = {};
201198

@@ -205,6 +202,12 @@ class PackDir {
205202

206203
this.cleanFile(fileName);
207204

205+
if (this.params.skipDirName && pathStat.isDirectory()) {
206+
params.cwd = path;
207+
pathWithMask = '*';
208+
pathToZipFile = Path.join('..', pathToZipFile);
209+
}
210+
208211
let args = [
209212
'-r',
210213
this.escapeArg(pathToZipFile),

0 commit comments

Comments
 (0)