Skip to content

Commit

Permalink
Merge pull request #8 from aynurin/skipDirName_parameter
Browse files Browse the repository at this point in the history
Added `skipDirName` param
  • Loading branch information
Z-AX authored Jul 13, 2016
2 parents 821f785 + 7caa01c commit e799d00
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class PackDir {
dmg: /darwin/,
dmgFormat: 'UDZO',
isSilent: false,
isSync: true
isSync: true,
skipDirName: true
};

this.DMG = '.dmg';
Expand Down Expand Up @@ -191,11 +192,7 @@ class PackDir {
let fileName = path + this.ZIP,
pathInfo = Path.parse(path),
pathStat = FS.statSync(path),
pathWithMask = (
pathStat.isDirectory()
? (pathInfo.base + Path.sep + '*')
: pathInfo.base
),
pathWithMask = pathInfo.base,
pathToZipFile = pathInfo.base + '.zip',
params = {};

Expand All @@ -205,6 +202,12 @@ class PackDir {

this.cleanFile(fileName);

if (this.params.skipDirName && pathStat.isDirectory()) {
params.cwd = path;
pathWithMask = '*';
pathToZipFile = Path.join('..', pathToZipFile);
}

let args = [
'-r',
this.escapeArg(pathToZipFile),
Expand Down

0 comments on commit e799d00

Please sign in to comment.