1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-08-13 22:12:50 +02:00

Chore: trying to fix notarization

This commit is contained in:
Laurent Cozic
2020-12-05 11:06:20 +00:00
parent 8d90cc234f
commit 245976f659

View File

@@ -2,6 +2,24 @@ const fs = require('fs');
const path = require('path');
const electron_notarize = require('electron-notarize');
function execCommand(command) {
const exec = require('child_process').exec;
return new Promise((resolve, reject) => {
exec(command, (error, stdout, stderr) => {
if (error) {
if (error.signal == 'SIGTERM') {
resolve('Process was killed');
} else {
reject(new Error([stdout.trim(), stderr.trim()].join('\n')));
}
} else {
resolve([stdout.trim(), stderr.trim()].join('\n'));
}
});
});
}
module.exports = async function(params) {
if (process.platform !== 'darwin') return;
@@ -48,5 +66,11 @@ module.exports = async function(params) {
ascProvider: process.env.APPLE_ASC_PROVIDER,
});
console.log('Staple notarization ticket to the app...');
const staplerCmd = `xcrun stapler staple "${appPath}"`;
console.log(`> ${staplerCmd}`);
console.log(await execCommand(staplerCmd));
console.log(`Done notarizing ${appId}`);
};