fix: process is not defined
This commit is contained in:
parent
e962351b13
commit
7aa6d6ebeb
@ -6,9 +6,14 @@ exports.default = async function notarizing(context) {
|
||||
return
|
||||
}
|
||||
|
||||
if (!process.env.APPLE_ID || !process.env.APPLE_APP_SPECIFIC_PASSWORD || !process.env.APPLE_TEAM_ID) {
|
||||
console.log('Skipping notarization')
|
||||
return
|
||||
}
|
||||
|
||||
const appName = context.packager.appInfo.productFilename
|
||||
|
||||
const notarized = await notarize({
|
||||
await notarize({
|
||||
appPath: `${context.appOutDir}/${appName}.app`,
|
||||
appBundleId: 'com.kangfenmao.CherryStudio',
|
||||
appleId: process.env.APPLE_ID,
|
||||
@ -16,7 +21,5 @@ exports.default = async function notarizing(context) {
|
||||
teamId: process.env.APPLE_TEAM_ID
|
||||
})
|
||||
|
||||
console.log('Notarized:', notarized)
|
||||
|
||||
return notarized
|
||||
console.log('Notarized app:', appName)
|
||||
}
|
||||
|
||||
@ -1,13 +1,10 @@
|
||||
import localforage from 'localforage'
|
||||
import KeyvStorage from '@kangfenmao/keyv-storage'
|
||||
import * as Sentry from '@sentry/electron/renderer'
|
||||
import { isProduction } from './utils'
|
||||
|
||||
function initSentry() {
|
||||
// Disable sentry in development mode
|
||||
if (process?.env?.NODE_ENV === 'development') {
|
||||
return
|
||||
}
|
||||
|
||||
async function initSentry() {
|
||||
if (await isProduction()) {
|
||||
Sentry.init({
|
||||
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
|
||||
|
||||
@ -22,6 +19,7 @@ function initSentry() {
|
||||
replaysOnErrorSampleRate: 1.0
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
localforage.config({
|
||||
|
||||
@ -98,3 +98,13 @@ export const firstLetter = (str?: string) => {
|
||||
export function isFreeModel(model: Model) {
|
||||
return (model.id + model.name).toLocaleLowerCase().includes('free')
|
||||
}
|
||||
|
||||
export async function isProduction() {
|
||||
const { isPackaged } = await window.api.getAppInfo()
|
||||
return isPackaged
|
||||
}
|
||||
|
||||
export async function isDev() {
|
||||
const isProd = await isProduction()
|
||||
return !isProd
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user