From adbef730a65b223d28aba91a48e1134291762064 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 11 Nov 2020 21:26:47 +1000 Subject: [PATCH] ensure repos.bzl is up to date at end of run --- scripts/synci18n.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/synci18n.py b/scripts/synci18n.py index cf236df07..34703ec6a 100644 --- a/scripts/synci18n.py +++ b/scripts/synci18n.py @@ -82,7 +82,7 @@ def module_git_info(module: Module) -> GitInfo: return GitInfo(sha1=sha.decode("utf8"), shallow_since=shallow.decode("utf8")) -def update_repos_bzl(): +def update_repos_bzl(commit: bool): # gather changes entries = {} for module in modules: @@ -105,7 +105,8 @@ def update_repos_bzl(): out.append(line) open(path, "w").writelines(out) - commit_if_changed(".") + if commit: + commit_if_changed(".") def commit_if_changed(folder: str): @@ -153,10 +154,14 @@ def push_i18n_changes(): update_git_repos() +update_repos_bzl(commit=False) update_ftl_templates() if len(sys.argv) > 1 and sys.argv[1] == "all": update_po_templates() else: print("skipping po updates") push_i18n_changes() -update_repos_bzl() +# we need to run this again - the first time ensures we merge +# the latest changes into the po files, and the second time ensures +# we're up to date after we made changes to the repos +update_repos_bzl(commit=True)