Skip to content

Commit

Permalink
add new option (--url cusom_repo_rul)
Browse files Browse the repository at this point in the history
  • Loading branch information
elad bahar committed Sep 12, 2024
1 parent 9165244 commit fbc8f7a
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/e-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ const archOption = new Option(
'Set the desired architecture for the build',
).choices(['x86', 'x64', 'arm', 'arm64']);


let customRepo = null;

function createConfig(options) {
const root = resolvePath(options.root);
const homedir = os.homedir();
Expand Down Expand Up @@ -54,9 +57,16 @@ function createConfig(options) {
fork: options.useHttps
? `https://github.com/${options.fork}.git`
: `[email protected]:${options.fork}.git`,
}),
})
};

customRepo = null;
if (options.url) {
electron.origin = `${options.url}.git`;
customRepo = options.url;
console.log(`set custom electron repository url '${electron.origin}'`);
}

return {
$schema: URI.file(path.resolve(__dirname, '..', 'evm-config.schema.json')).toString(),
reclient: options.reclient,
Expand All @@ -80,15 +90,15 @@ function createConfig(options) {
}

function runGClientConfig(config) {
const { root } = config;
const { root} = config;
depot.ensure();
const exec = 'gclient';
const args = [
'config',
'--name',
'src/electron',
'--unmanaged',
'https://github.com/electron/electron',
customRepo || 'https://github.com/electron/electron',
];
const opts = {
cwd: root,
Expand Down Expand Up @@ -163,6 +173,10 @@ program
'--fork <username/electron>',
`Add a remote fork of Electron with the name 'fork'. This should take the format 'username/electron'`,
)
.option(
'--url <target>',
`Set a custom Electron build repository url. This should take the format 'https://www.foo.com/foo.git'`,
)
.action((name, options) => {
if (options.import && !options.out) {
// e.g. the default out dir for a testing build is 'Testing'
Expand Down

0 comments on commit fbc8f7a

Please sign in to comment.