Skip to content
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: electron builder binaries base url from env #19

Merged
merged 1 commit into from
Sep 23, 2019
Merged

feat: electron builder binaries base url from env #19

merged 1 commit into from
Sep 23, 2019

Conversation

okmiim
Copy link
Contributor

@okmiim okmiim commented Jul 30, 2019

Added function to get the base URL for GitHub (electron-builder-binaries) using environment variables used by electron-builder (https://github.com/electron-userland/electron-builder/blob/f3404d32f029dfb63e83067012f15ef67838f326/packages/app-builder-lib/src/binDownload.ts#L21-L25).
This could also be extended in a similar way for "ELECTRON_BUILDER_BINARIES_CUSTOM_DIR".
The implantation is not tested, however it is structured the same way as

func getBaseUrl(config *ElectronDownloadOptions) string {
v := os.Getenv("NPM_CONFIG_ELECTRON_MIRROR")
if len(v) == 0 {
v = os.Getenv("npm_config_electron_mirror")
}
if len(v) == 0 {
v = os.Getenv("ELECTRON_MIRROR")
}
if len(v) == 0 {
v = config.Mirror
}
if len(v) == 0 {
v = "https://github.com/electron/electron/releases/download/v"
}
return v
}
and should work without any problems.

pkg/download/tool.go Show resolved Hide resolved
pkg/linuxTools/tool.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants