Skip to content

Commit

Permalink
feat: allow to set geckodriver via GECKODRIVER_PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Apr 26, 2024
1 parent 2a6c1b1 commit 942cb41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ Type: `string`
Don't download Geckodriver, instead use a custom path to it, e.g. a cached binary.

Type: `string`<br />
Default: `process.env.GECKODRIVER_FILEPATH`
Default: `process.env.GECKODRIVER_PATH`

### `cacheDir`
The path to the root of the cache directory.
Expand Down
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ const log = logger('geckodriver')

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

0 comments on commit 942cb41

Please sign in to comment.