Skip to content

Commit

Permalink
fix: sign child paths in order of depth (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed May 12, 2020
1 parent 63d7b60 commit d99eebd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sign.js
Expand Up @@ -198,6 +198,16 @@ function signApplicationAsync (opts) {
}

var promise
/**
* Sort the child paths by how deep they are in the file tree. Some arcane apple
* logic expects the deeper files to be signed first otherwise strange errors get
* thrown our way
*/
childPaths = childPaths.sort((a, b) => {
const aDepth = a.split(path.sep).length
const bDepth = b.split(path.sep).length
return bDepth - aDepth
})
if (opts.entitlements) {
// Sign with entitlements
promise = Promise.mapSeries(childPaths, function (filePath) {
Expand Down

0 comments on commit d99eebd

Please sign in to comment.