From c3e41da0fa256ad7f6b4bc76b9d069dedecdfef4 Mon Sep 17 00:00:00 2001 From: Jeffrey Rennie Date: Thu, 27 May 2021 15:59:26 -0700 Subject: [PATCH] fix: make `generate_index_ts()` deterministic (#1104) Fixes https://github.com/googleapis/synthtool/issues/1103 --- synthtool/languages/node.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/synthtool/languages/node.py b/synthtool/languages/node.py index 65b01bf88..0c5a058d0 100644 --- a/synthtool/languages/node.py +++ b/synthtool/languages/node.py @@ -138,6 +138,9 @@ def generate_index_ts(versions: List[str], default_version: str) -> None: logger.error(err_msg) raise AttributeError(err_msg) + # To make sure the output is always deterministic. + versions = sorted(versions) + # compose default version's index.ts file path versioned_index_ts_path = Path("src") / default_version / "index.ts" clients = extract_clients(versioned_index_ts_path)