Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: sign macOS objects depth-first (close #4932) (#4993)
This fix was directly lifted from electron/osx-sign#228 authored by @MarshallOfSound
  • Loading branch information
pfrazee committed May 26, 2020
1 parent ee59eed commit 7f8d59c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/app-builder-lib/electron-osx-sign/sign.js
Expand Up @@ -119,6 +119,17 @@ async function verifySignApplicationAsync (opts) {
function signApplicationAsync (opts) {
return walkAsync(getAppContentsPath(opts))
.then(async function (childPaths) {
/**
* 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
})

function ignoreFilePath (opts, filePath) {
if (opts.ignore) {
return opts.ignore.some(function (ignore) {
Expand Down

0 comments on commit 7f8d59c

Please sign in to comment.