forked from balena-io/etcher
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch electron-builder to fix signing on macos
Remove this once electron-userland/electron-builder#4993 is merged Change-type: patch
- Loading branch information
1 parent
89aef9a
commit 4bf88a0
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
diff --git a/node_modules/app-builder-lib/electron-osx-sign/sign.js b/node_modules/app-builder-lib/electron-osx-sign/sign.js | ||
index 3b85d83c..87da4e57 100644 | ||
--- a/node_modules/app-builder-lib/electron-osx-sign/sign.js | ||
+++ b/node_modules/app-builder-lib/electron-osx-sign/sign.js | ||
@@ -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) { |