diff --git a/.changeset/pre.json b/.changeset/pre.json index 7cff3f7..f517a8b 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -5,6 +5,7 @@ "app-builder-bin": "4.2.0" }, "changesets": [ - "orange-seahorses-listen" + "orange-seahorses-listen", + "rotten-fireants-flow" ] } diff --git a/.changeset/rotten-fireants-flow.md b/.changeset/rotten-fireants-flow.md new file mode 100644 index 0000000..d7f01f9 --- /dev/null +++ b/.changeset/rotten-fireants-flow.md @@ -0,0 +1,5 @@ +--- +"app-builder-bin": patch +--- + +fix: Use npm config.mirror first before env variables for download URL diff --git a/pkg/electron/electronDownloader.go b/pkg/electron/electronDownloader.go index 13ead95..328bb7a 100644 --- a/pkg/electron/electronDownloader.go +++ b/pkg/electron/electronDownloader.go @@ -83,15 +83,15 @@ func downloadElectron(configs []ElectronDownloadOptions) ([]string, error) { } func getBaseUrl(config *ElectronDownloadOptions) string { - v := os.Getenv("NPM_CONFIG_ELECTRON_MIRROR") + v := config.Mirror if len(v) == 0 { - v = os.Getenv("npm_config_electron_mirror") + v = os.Getenv("NPM_CONFIG_ELECTRON_MIRROR") } if len(v) == 0 { - v = os.Getenv("ELECTRON_MIRROR") + v = os.Getenv("npm_config_electron_mirror") } if len(v) == 0 { - v = config.Mirror + v = os.Getenv("ELECTRON_MIRROR") } if len(v) == 0 { if strings.Contains(config.Version, "-nightly.") {