Fix the --target/-t option of yarn dist…#1593
Open
savetheclocktower wants to merge 3 commits into
Open
Conversation
…and eliminate the positional `[platform]` argument.
ottok
reviewed
Jun 2, 2026
| ], | ||
| target: [ | ||
| { target: 'dmg' }, | ||
| { target: 'zip' } |
There was a problem hiding this comment.
Could we have here also dir as a plain unpacked directory target?
Contributor
Author
There was a problem hiding this comment.
If we do that, it gets built by default when -t is omitted.
I'll consider reworking this to allow specifying of targets that are not there by default.
Contributor
Author
|
OK, just updated the PR to allow the user to specify arbitrary targets (comma-separated if more than one is desired) instead of limiting the user to the set of targets that are already present. |
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.


…and eliminate the positional
[platform]argument.I thought I’d have a crack at revisiting #1397 with a bit more care. We already have code for deciding which targets to build; it just misfires a bit.
platformargument (which never worked anyway because we usedyargswrong) is eliminated. We’ll just filter the options to include only the platform you’re actually on, since that’s what happens in effect anyway.platformwasn’t implemented properly, thetargetkeyword switch didn’t work either, sincewhatToBuildbailed early whenplatformwas missing. And then we didn’t filter targets correctly anyway, so that needed fixing as well.script/electron-builder.js… #1397’s target names overlapped only somewhat with the official target names fromelectron-builder. This time around I’m just reusing the target names that are already defined.(Now it supports multiple comma-separated targets.)--targetstill accepts only one target — but if people want it to accept multiple (e.g.,--target=rpm,tar.gz), that could be accomplished rather easily.Testing
This works just fine in my experiments, but please feel free to test it out with commands like
or an appropriate target for your platform.