File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -3,21 +3,23 @@ import fs from 'fs'
33import os from 'os'
44import path from 'path'
55import { Alert } from '@/infra/alert'
6- // eslint-disable-next-line @typescript-eslint/no-require-imports
6+ import { createRequire } from 'module'
7+
8+ const require = createRequire ( import . meta. url ) ;
79const download : ( arg : Record < string , unknown > ) => Promise < string > = require ( 'download-chromium' )
810
911export type ChromiumProviderFunc = ( ) => Promise < string | undefined >
1012
1113const selectFromLocalTitle = '选择本地Chromium'
1214
13- const defaultChromiumPath = {
14- osx : [ `${ os . homedir ( ) } /Applications/Google Chrome.app` , '/Applications/Google Chrome.app' ] ,
15- win : [ 'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe' ] ,
16- }
17-
1815const downloadFromInternetTitle = '帮我下载Chromium'
1916
2017export class ChromiumPathProvider {
18+ static defaultChromiumPath = {
19+ osx : [ `${ os . homedir ( ) } /Applications/Google Chrome.app` , '/Applications/Google Chrome.app' ] ,
20+ win : [ 'C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe' ] ,
21+ }
22+
2123 static lookupExecutableFromMacApp = ( path ?: string ) => {
2224 if ( path === undefined ) return
2325
You can’t perform that action at this time.
0 commit comments