forked from electron/build-tools
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add new option (--url cusom_repo_rul)
- Loading branch information
elad bahar
committed
Sep 12, 2024
1 parent
9165244
commit fbc8f7a
Showing
1 changed file
with
17 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(); | ||
|
@@ -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, | ||
|
@@ -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, | ||
|
@@ -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' | ||
|