mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-06-09 01:30:15 +08:00
🔨 Refactor: optimize auto update
This commit is contained in:
@@ -1,37 +1,36 @@
|
||||
"use strict";
|
||||
'use strict'
|
||||
|
||||
require('dotenv').config()
|
||||
|
||||
const { notarize } = require("@electron/notarize")
|
||||
const { notarize } = require('@electron/notarize')
|
||||
const {
|
||||
ELECTRON_SKIP_NOTARIZATION,
|
||||
XCODE_APP_LOADER_EMAIL,
|
||||
XCODE_APP_LOADER_PASSWORD,
|
||||
XCODE_APP_LOADER_PASSWORD
|
||||
} = process.env
|
||||
|
||||
async function main(context) {
|
||||
async function main (context) {
|
||||
const { electronPlatformName, appOutDir } = context
|
||||
|
||||
if (
|
||||
electronPlatformName !== "darwin" ||
|
||||
ELECTRON_SKIP_NOTARIZATION === "true" ||
|
||||
electronPlatformName !== 'darwin' ||
|
||||
ELECTRON_SKIP_NOTARIZATION === 'true' ||
|
||||
!XCODE_APP_LOADER_EMAIL ||
|
||||
!XCODE_APP_LOADER_PASSWORD
|
||||
) {
|
||||
console.log("Skipping Apple notarization.")
|
||||
return;
|
||||
console.log('Skipping Apple notarization.')
|
||||
return
|
||||
}
|
||||
|
||||
console.log("Starting Apple notarization.")
|
||||
const appName = context.packager.appInfo.productFilename;
|
||||
console.log('Starting Apple notarization.')
|
||||
const appName = context.packager.appInfo.productFilename
|
||||
await notarize({
|
||||
appBundleId: "com.kuingsmile.piclist",
|
||||
appBundleId: 'com.kuingsmile.piclist',
|
||||
appPath: `${appOutDir}/${appName}.app`,
|
||||
appleId: XCODE_APP_LOADER_EMAIL,
|
||||
appleIdPassword: XCODE_APP_LOADER_PASSWORD,
|
||||
appleIdPassword: XCODE_APP_LOADER_PASSWORD
|
||||
})
|
||||
console.log("Finished Apple notarization.")
|
||||
|
||||
console.log('Finished Apple notarization.')
|
||||
}
|
||||
|
||||
exports.default = main;
|
||||
exports.default = main
|
||||
|
||||
Reference in New Issue
Block a user