Skip to content

Commit

Permalink
don't propagate cacheDir to driver
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Jul 25, 2023
1 parent af27933 commit e4ad2a9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import { DEFAULT_HOSTNAME, log } from './constants.js'
import type { GeckodriverParameters } from './types.js'

export async function start (params: GeckodriverParameters) {
const { cacheDir, ...startArgs } = params
let geckoDriverPath = process.env.GECKODRIVER_FILEPATH || params.customGeckoDriverPath
if (!geckoDriverPath) {
geckoDriverPath = await downloadDriver(params.geckoDriverVersion, params.cacheDir)
geckoDriverPath = await downloadDriver(params.geckoDriverVersion, cacheDir)
}

if (!(await hasAccess(geckoDriverPath))) {
throw new Error('Failed to access Geckodriver, was it installed successfully?')
}

params.host = params.host || DEFAULT_HOSTNAME

const args = parseParams(params)
startArgs.host = startArgs.host || DEFAULT_HOSTNAME
const args = parseParams(startArgs)
log.info(`Starting Geckodriver at ${geckoDriverPath} with params: ${args.join(' ')}`)
return cp.spawn(geckoDriverPath, args)
}
Expand Down

0 comments on commit e4ad2a9

Please sign in to comment.