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
|
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 appName = context.packager.appInfo.productFilename
|
||||||
|
|
||||||
const notarized = await notarize({
|
await notarize({
|
||||||
appPath: `${context.appOutDir}/${appName}.app`,
|
appPath: `${context.appOutDir}/${appName}.app`,
|
||||||
appBundleId: 'com.kangfenmao.CherryStudio',
|
appBundleId: 'com.kangfenmao.CherryStudio',
|
||||||
appleId: process.env.APPLE_ID,
|
appleId: process.env.APPLE_ID,
|
||||||
@ -16,7 +21,5 @@ exports.default = async function notarizing(context) {
|
|||||||
teamId: process.env.APPLE_TEAM_ID
|
teamId: process.env.APPLE_TEAM_ID
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log('Notarized:', notarized)
|
console.log('Notarized app:', appName)
|
||||||
|
|
||||||
return notarized
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,13 +1,10 @@
|
|||||||
import localforage from 'localforage'
|
import localforage from 'localforage'
|
||||||
import KeyvStorage from '@kangfenmao/keyv-storage'
|
import KeyvStorage from '@kangfenmao/keyv-storage'
|
||||||
import * as Sentry from '@sentry/electron/renderer'
|
import * as Sentry from '@sentry/electron/renderer'
|
||||||
|
import { isProduction } from './utils'
|
||||||
|
|
||||||
function initSentry() {
|
async function initSentry() {
|
||||||
// Disable sentry in development mode
|
if (await isProduction()) {
|
||||||
if (process?.env?.NODE_ENV === 'development') {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
Sentry.init({
|
Sentry.init({
|
||||||
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
|
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
|
||||||
|
|
||||||
@ -21,6 +18,7 @@ function initSentry() {
|
|||||||
replaysSessionSampleRate: 0.1,
|
replaysSessionSampleRate: 0.1,
|
||||||
replaysOnErrorSampleRate: 1.0
|
replaysOnErrorSampleRate: 1.0
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
|||||||
@ -98,3 +98,13 @@ export const firstLetter = (str?: string) => {
|
|||||||
export function isFreeModel(model: Model) {
|
export function isFreeModel(model: Model) {
|
||||||
return (model.id + model.name).toLocaleLowerCase().includes('free')
|
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