Skip to content

Commit

Permalink
Merge pull request #75 from sethlu/bug-fix-70
Browse files Browse the repository at this point in the history
opts.ignored revised
  • Loading branch information
sethlu committed Jul 18, 2016
2 parents a01e8a4 + 4a0e9fa commit 1bd17ca
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,17 @@ function walkAsync (dirPath) {
function signApplicationAsync (opts) {
return walkAsync(getAppContentsPath(opts))
.then(function (childPaths) {
function ignoreFilePath (opts, filePath) {
if (opts.ignore) {
if (typeof opts.ignore === 'function') {
return opts.ignore(filePath)
} else if (typeof opts.ignore === 'string') {
return filePath.match(opts.ignore)
}
}
return false
}

if (opts.binaries) childPaths = childPaths.concat(opts.binaries)

var args = [
Expand All @@ -386,6 +397,10 @@ function signApplicationAsync (opts) {
if (opts.entitlements) {
// Sign with entitlements
promise = Promise.mapSeries(childPaths, function (filePath) {
if (ignoreFilePath(opts, filePath)) {
debuglog('Skipped... ' + filePath)
return
}
debuglog('Signing... ' + filePath)
return execFileAsync('codesign', args.concat('--entitlements', opts['entitlements-inherit'], filePath))
})
Expand All @@ -396,6 +411,10 @@ function signApplicationAsync (opts) {
} else {
// Otherwise normally
promise = Promise.mapSeries(childPaths, function (filePath) {
if (ignoreFilePath(opts, filePath)) {
debuglog('Skipped... ' + filePath)
return
}
debuglog('Signing... ' + filePath)
return execFileAsync('codesign', args.concat(filePath))
})
Expand Down

0 comments on commit 1bd17ca

Please sign in to comment.