Repository navigation
fix: add --platform CLI argument - #1285
Merged
Merged
Conversation
The platform option is a documented RebuildOptions field used by the rebuild() API, but the CLI never defined a --platform flag nor passed platform through, so it always defaulted to process.platform. Add a platform entry to the CLI options object and thread platform: argv.platform into the rebuild() call alongside arch. Fixes #1240 Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01Pz3ypFU3omZPd7LFeTcSEU
MarshallOfSound
approved these changes
Jun 27, 2026
MarshallOfSound
marked this pull request as ready for review
June 27, 2026 21:45
dsanders11
approved these changes
Jun 27, 2026
|
🎉 This PR is included in version 4.0.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Samuel Attard · Slack thread
Before / After
Before:
platformis a documentedRebuildOptionsfield consumed by therebuild()API, but the CLI never exposed it. Runningelectron-rebuild --platform=...had no effect — the flag wasn't defined, so the value was never accepted or forwarded, and the rebuild always fell back to the host'sprocess.platform.After:
--platformis a recognized CLI flag (it now shows up in--help) and its value is forwarded into therebuild()call, letting users override the target platform the same way--archoverrides the target architecture.How
The change is in
src/cli.ts:platformentry to theoptionsobject, mirroring the existingarchoption (type: 'string'with a matching description).platform: (argv.platform as NodeJS.Platform) || process.platforminto therebuild()options object, alongsidearch.Fixes #1240
Generated by Claude Code