Skip to content

feat: allow setting dist URL via ELECTRON_REBUILD_DIST_URL env var - #1287

Merged
MarshallOfSound merged 1 commit into
mainfrom
dist-url-env-var
Jul 1, 2026
Merged

MarshallOfSound merged 1 commit into
mainfrom
dist-url-env-var

Conversation

@claude

@claude claude Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Requested by Samuel Attard · Slack thread

Before / After

  • Before: The dist (header tarball) URL can only be set with the --dist-url CLI flag.
  • After: It also reads from the ELECTRON_REBUILD_DIST_URL environment variable when the flag is absent. The --dist-url flag takes precedence when both are set.

How

In src/cli.ts, the headerURL passed to rebuild() now falls back to the env var: argv['dist-url'] || process.env.ELECTRON_REBUILD_DIST_URL. The --dist-url option description and the README options note were updated to mention the equivalent environment variable.

Why

This makes it easier to configure a custom header/dist URL in packaging and CI contexts — mirrors, proxies, AUR build scripts — where threading a CLI flag all the way through to electron-rebuild is awkward.

Closes #301 (#301)


Generated by Claude Code

Fall back to the ELECTRON_REBUILD_DIST_URL environment variable when the
--dist-url flag is not provided. This makes it easier to configure a custom
header/dist URL in packaging and CI contexts (mirrors, proxies, AUR build
scripts) where threading a CLI flag through is awkward. The --dist-url flag
takes precedence when both are set.

Closes #301
@MarshallOfSound
MarshallOfSound marked this pull request as ready for review June 29, 2026 19:52
@MarshallOfSound
MarshallOfSound requested a review from a team as a code owner June 29, 2026 19:52
@MarshallOfSound
MarshallOfSound merged commit 12a0a2b into main Jul 1, 2026
9 checks passed
@MarshallOfSound
MarshallOfSound deleted the dist-url-env-var branch July 1, 2026 05:13
@electron-npm-package-publisher

Copy link
Copy Markdown

🎉 This PR is included in version 4.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read dist-url from environment variable?

3 participants