Skip to content

Commit faa13a8

Browse files
committed
[update-checkout] Generate ssh/https urls from a config template rather than hardcoding.
This allows for other configuration files to specify other ssh/https locations.
1 parent 12dc79a commit faa13a8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

utils/update-checkout

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ def obtain_additional_swift_sources(
6464
echo=False):
6565
if not os.path.isdir(os.path.join(dir_name, ".git")):
6666
print("--- Cloning '" + dir_name + "' ---")
67-
if with_ssh is True:
68-
remote = "[email protected]:" + repo + '.git'
67+
if with_ssh is True or "https_clone_pattern" not in config:
68+
remote = config["ssh_clone_pattern"] % repo
6969
else:
70-
remote = "https://github.com/" + repo + '.git'
70+
remote = config["https_clone_pattern"] % repo
7171
if skip_history:
7272
shell.call(['git', 'clone', '--recursive', '--depth', '1',
7373
remote, dir_name], echo=False)

utils/update-checkout-config.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2+
"ssh_clone_pattern": "[email protected]:%s.git",
3+
"https_clone_pattern": "https://github.com/%s.git",
24
"repositories" : {
35
"llvm": "apple/swift-llvm",
46
"clang": "apple/swift-clang",

0 commit comments

Comments
 (0)