forked from usebruno/bruno
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotarize.js
More file actions
38 lines (32 loc) · 1.01 KB
/
Copy pathnotarize.js
File metadata and controls
38 lines (32 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require('dotenv').config({ path: process.env.DOTENV_PATH });
const fs = require('fs');
const path = require('path');
const electron_notarize = require('electron-notarize');
const notarize = async function (params) {
if (process.platform !== 'darwin') {
return;
}
let appId = 'com.usebruno.app';
let appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`);
if (!fs.existsSync(appPath)) {
console.error(`Cannot find application at: ${appPath}`);
return;
}
console.log(`Notarizing ${appId} found at ${appPath} using Apple ID ${process.env.APPLE_ID}`);
const teamId = 'P3WTZH48ZB';
try {
await electron_notarize.notarize({
tool: 'notarytool',
appBundleId: appId,
appPath: appPath,
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_ID_PASSWORD,
ascProvider: teamId,
teamId: teamId
});
} catch (error) {
console.error(error);
}
console.log(`Done notarizing ${appPath}`);
};
module.exports = notarize;