File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -6,18 +6,18 @@ import { DEFAULT_HOSTNAME, log } from './constants.js'
66import type { GeckodriverParameters } from './types.js'
77
88export async function start ( params : GeckodriverParameters ) {
9+ const { cacheDir, ...startArgs } = params
910 let geckoDriverPath = process . env . GECKODRIVER_FILEPATH || params . customGeckoDriverPath
1011 if ( ! geckoDriverPath ) {
11- geckoDriverPath = await downloadDriver ( params . geckoDriverVersion , params . cacheDir )
12+ geckoDriverPath = await downloadDriver ( params . geckoDriverVersion , cacheDir )
1213 }
1314
1415 if ( ! ( await hasAccess ( geckoDriverPath ) ) ) {
1516 throw new Error ( 'Failed to access Geckodriver, was it installed successfully?' )
1617 }
1718
18- params . host = params . host || DEFAULT_HOSTNAME
19-
20- const args = parseParams ( params )
19+ startArgs . host = startArgs . host || DEFAULT_HOSTNAME
20+ const args = parseParams ( startArgs )
2121 log . info ( `Starting Geckodriver at ${ geckoDriverPath } with params: ${ args . join ( ' ' ) } ` )
2222 return cp . spawn ( geckoDriverPath , args )
2323}
You can’t perform that action at this time.
0 commit comments