Skip to content

Commit 7f2bf42

Browse files
committed
FIX i18n builds.
1 parent 3141bd8 commit 7f2bf42

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

build_docs.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def git_clone(repository: str, directory: Path, branch_or_tag=None):
340340
if directory.exists():
341341
shutil.rmtree(directory)
342342
logging.info("Cloning %s into %s", repository, directory)
343-
directory.mkdir(mode=0o775)
343+
directory.mkdir(mode=0o775, parents=True, exist_ok=True)
344344
run(["git", "clone", repository, directory])
345345
if branch_or_tag:
346346
run(["git", "-C", directory, "reset", "--hard", branch_or_tag, "--"])
@@ -394,11 +394,14 @@ def translation_branch(locale_repo, locale_clone_dir, needed_version: str):
394394
395395
This function looks for remote branches on the given repo, and
396396
returns the name of the nearest existing branch.
397+
398+
It could be enhanced to return tags, if needed, just return the
399+
tag as a string (without the `origin/` branch prefix).
397400
"""
398401
git_clone(locale_repo, locale_clone_dir)
399402
remote_branches = run(["git", "-C", locale_clone_dir, "branch", "-r"]).stdout
400403
branches = re.findall(r"/([0-9]+\.[0-9]+)$", remote_branches, re.M)
401-
return locate_nearest_version(branches, needed_version)
404+
return "origin/" + locate_nearest_version(branches, needed_version)
402405

403406

404407
@contextmanager

0 commit comments

Comments
 (0)