feat: add an option to checkout Electron from a fork#863
Conversation
Can you describe more of the difficulty you're having? There's definitely folks building from a fork using It's a bit inefficient since you'll have the extra sync, but it's the same inefficiency as setting things up to build an older branch of Electron as well. Alternatively for you, instead of your current workaround you could try |
|
It’s exactly that. The sync → switch → sync causes the pain. The initial sync from electron/main is completely wasted time if I don’t plan on building from main. And I have to build it 5x for every release (all platforms I support). The --spec param might work. I’ll try and get back to you. Thanks for the tip. |
Problem
Right now it's impossible to use
@electron/build-toolsto build from a fork. I actively maintain a fork of Electron with features that wouldn't make sense upstream, but I still regularly merge upstream to keep up with Chromium/Node upgrades.Currently my workaround is to do this:
Solution
This PR adds a flag for
--fork-as-origintoe initfor users who want to checkout Electron directly from their fork rather thanelectron/electron.This would simplify my build script to this:
Behavior
--forkis maintained:originand.gclientcheckout fromelectron/electronforkremote is pointed to the option passed by--fork--fork cool-fork/electron --fork-as-origin:originand.gclientcheck out from the forkupstreamis added pointing atelectron/electronTesting
Added new tests for existing behavior, checking out with SSH, HTTPS and checking out with
--fork-as-origin.