From 0fecf3a56b11fe0791e8618d682bf8ebaced6112 Mon Sep 17 00:00:00 2001 From: James Mineau Date: Thu, 29 Aug 2024 17:23:21 -0600 Subject: [PATCH] only make latest docs if changes present --- docs/make_docs.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/make_docs.py b/docs/make_docs.py index edad97a..c6c81da 100644 --- a/docs/make_docs.py +++ b/docs/make_docs.py @@ -82,7 +82,8 @@ def checkout_version(version: str): os.chdir(docs) # Pull the latest changes from the git repository -subprocess.run(['git', 'pull'], check=True) +status = subprocess.run(['git', 'pull'], check=True, + stdout=subprocess.PIPE) # Iterate over the versions in the switcher for v in switcher: @@ -98,6 +99,9 @@ def checkout_version(version: str): if 'latest' not in to_build and version not in to_build: # Skip building the latest version if it's not specified continue + elif 'Already up to date' in status.stdout.decode(): + # Skip building the latest version if the repository is up to date + continue print(f"Building version {version} ({name})") # Build the latest version from the head of main branch checkout_version('latest')