mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-08 00:47:15 +08:00
change puppeteer import path for ui project - always use the one in home folder
This commit is contained in:
-6
@@ -2,7 +2,6 @@ import * as path from 'node:path'
|
|||||||
import * as os from 'node:os'
|
import * as os from 'node:os'
|
||||||
import * as fs from 'node:fs'
|
import * as fs from 'node:fs'
|
||||||
import type { InstalledBrowser } from '@puppeteer/browsers'
|
import type { InstalledBrowser } from '@puppeteer/browsers'
|
||||||
import { isDev } from '../../runtimeDesidedEnv'
|
|
||||||
|
|
||||||
const expectBuildId = process.env.EXPECT_CHROME_FOR_PUPPETEER_BUILD_ID || '121.0.6167.85'
|
const expectBuildId = process.env.EXPECT_CHROME_FOR_PUPPETEER_BUILD_ID || '121.0.6167.85'
|
||||||
const cacheDir = path.join(
|
const cacheDir = path.join(
|
||||||
@@ -13,15 +12,10 @@ const cacheDir = path.join(
|
|||||||
)
|
)
|
||||||
|
|
||||||
const getPuppeteerManagerModule = async () => {
|
const getPuppeteerManagerModule = async () => {
|
||||||
if (!isDev) {
|
|
||||||
const runtimeDependencies = await import(
|
const runtimeDependencies = await import(
|
||||||
path.join(os.homedir(), '.bossgeekgo', 'external-node-runtime-dependencies/index.mjs')
|
path.join(os.homedir(), '.bossgeekgo', 'external-node-runtime-dependencies/index.mjs')
|
||||||
)
|
)
|
||||||
return runtimeDependencies.puppeteerManager
|
return runtimeDependencies.puppeteerManager
|
||||||
} else {
|
|
||||||
const importResult = await import('@puppeteer/browsers')
|
|
||||||
return importResult
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const getExpectPuppeteerExecutablePath = async () => {
|
export const getExpectPuppeteerExecutablePath = async () => {
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
export const isDev = process.env.NODE_ENV === 'development'
|
|
||||||
@@ -9,7 +9,6 @@ import {
|
|||||||
writeConfigFile
|
writeConfigFile
|
||||||
} from '@bossgeekgo/geek-auto-start-chat-with-boss/runtime-file-utils.mjs'
|
} from '@bossgeekgo/geek-auto-start-chat-with-boss/runtime-file-utils.mjs'
|
||||||
import { ChildProcess } from 'child_process'
|
import { ChildProcess } from 'child_process'
|
||||||
import { isDev } from '../runtimeDesidedEnv'
|
|
||||||
import { getExpectPuppeteerExecutablePath } from '../flow/CHECK_AND_DOWNLOAD_DEPENDENCIES/check-and-download-puppeteer'
|
import { getExpectPuppeteerExecutablePath } from '../flow/CHECK_AND_DOWNLOAD_DEPENDENCIES/check-and-download-puppeteer'
|
||||||
let mainWindow: BrowserWindow
|
let mainWindow: BrowserWindow
|
||||||
|
|
||||||
@@ -90,12 +89,8 @@ export function createMainWindow(): void {
|
|||||||
|
|
||||||
const subProcessEnv = {
|
const subProcessEnv = {
|
||||||
...process.env,
|
...process.env,
|
||||||
MAIN_BOSSGEEKGO_UI_RUN_MODE: 'geekAutoStartWithBoss'
|
MAIN_BOSSGEEKGO_UI_RUN_MODE: 'geekAutoStartWithBoss',
|
||||||
}
|
|
||||||
if (!isDev) {
|
|
||||||
Object.assign(subProcessEnv, {
|
|
||||||
PUPPETEER_EXECUTABLE_PATH: await getExpectPuppeteerExecutablePath()
|
PUPPETEER_EXECUTABLE_PATH: await getExpectPuppeteerExecutablePath()
|
||||||
})
|
|
||||||
}
|
}
|
||||||
subProcessOfPuppeteer = childProcess.spawn(process.argv[0], process.argv.slice(1), {
|
subProcessOfPuppeteer = childProcess.spawn(process.argv[0], process.argv.slice(1), {
|
||||||
env: subProcessEnv,
|
env: subProcessEnv,
|
||||||
|
|||||||
Reference in New Issue
Block a user