-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: auto ubuntu packages download for local browsers #1036
Changes from 1 commit
9d1d380
ef2b78b
5a02cad
6c744ea
61ce0bf
6312a75
495fe22
3a83de3
3498cd3
86cab81
90088e8
bde19e0
90c0be2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,18 +29,6 @@ export const Driver = { | |
export type SupportedBrowser = (typeof Browser)[keyof typeof Browser]; | ||
export type SupportedDriver = (typeof Driver)[keyof typeof Driver]; | ||
|
||
export type VersionToPathMap = Record<string, string | Promise<string>>; | ||
export type BinaryName = Exclude<SupportedBrowser | SupportedDriver, SupportedBrowser & SupportedDriver>; | ||
export type BinaryKey = `${BinaryName}_${BrowserPlatform}`; | ||
export type OsName = string; | ||
export type OsVersion = string; | ||
export type OsPackagesKey = `${OsName}_${OsVersion}`; | ||
export type RegistryFileContents = { | ||
binaries: Record<BinaryKey, VersionToPathMap>; | ||
osPackages: Record<OsPackagesKey, string | Promise<string>>; | ||
meta: { version: number }; | ||
}; | ||
|
||
export const getNormalizedBrowserName = ( | ||
browserName?: string, | ||
): Exclude<SupportedBrowser, typeof Browser.CHROMIUM> | null => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need exclude here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We dont need to, i just wanted to show "chromium can't be returned here", because |
||
|
@@ -147,7 +135,7 @@ const getDriversDir = (): string => path.join(getCacheDir(), "drivers"); | |
const getDriverDir = (driverName: string, driverVersion: string): string => | ||
path.join(getDriversDir(), driverName, driverVersion); | ||
|
||
export const getOsPackagesDir = (osName: OsName, osVersion: OsVersion): string => | ||
export const getOsPackagesDir = (osName: string, osVersion: string): string => | ||
path.join(getCacheDir(), "packages", osName, osVersion); | ||
|
||
export const getGeckoDriverDir = (driverVersion: string): string => | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As now we dont map "browserName" to "driverName" for "runBrowserDriver", we dont need "getDriverNameForBrowserName", and instead i created this function, so in "installBrowser" we can be sure it only receives valid "browserName" of
SupportedBrowser
typeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way we can handle cases with invalid browser name outside of "install", so we know, what exactly user wanted to do, and we can provide relevant error message: