mirror of https://github.com/laurent22/joplin.git
Chore: trying to fix notarization
parent
8d90cc234f
commit
245976f659
|
@ -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}`);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue