Skip to content

Commit

Permalink
only make latest docs if changes present
Browse files Browse the repository at this point in the history
  • Loading branch information
jmineau committed Aug 29, 2024
1 parent 05d65b0 commit 0fecf3a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/make_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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')
Expand Down

0 comments on commit 0fecf3a

Please sign in to comment.