develar / app-builder

Generic helper tool to build app in a distributable format
MIT License
123 stars 62 forks source link

fix: Use config.mirror first before env variables for download URL #106

Closed theogravity closed 8 months ago

theogravity commented 9 months ago

This addresses an issue around download URL calculation as discovered in https://github.com/electron-userland/electron-builder/issues/6445#issuecomment-1971891352

It doesn't make sense that we look at the env variables first before user-configured values. It took me hours to troubleshoot why my custom electron binary url wasn't taking when using the mirror configuration option and realized through console logging various packages that my env var has NPM_CONFIG_ELECTRON_MIRROR set.

This PR re-orders how the URL is calculated by first checking the config.Mirror option first before the env vars.