Skip to content

Commit

Permalink
Sign macOS objects depth-first (close electron-userland#4932)
Browse files Browse the repository at this point in the history
This fix was directly lifted from electron/osx-sign#228 authored by @MarshallOfSound
  • Loading branch information
pfrazee committed May 20, 2020
1 parent ee59eed commit 8bd63b7
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 8bd63b7

Please sign in to comment.