From f76bae93a7255ef5fd39f90a8a15c7e43c54175f Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 8 Mar 2024 16:54:02 +0000 Subject: [PATCH] Tweak get_version --- conf.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/conf.py b/conf.py index c084170bd..be696c84f 100644 --- a/conf.py +++ b/conf.py @@ -14,10 +14,15 @@ def get_version(): pipe = Popen('git branch | grep \*', stdout=PIPE, shell=True, universal_newlines=True) version = pipe.stdout.read() - if version: - return version[:2] + null, version = version.split("*",1) + version = version.strip() + + if version == "master": + return "upcoming" + if version[:6] == "stable": + return version[-2:] else: - return 'unknown' + return "%s" % (version) extensions = ['sphinx_rtd_theme', 'sphinx_rtd_dark_mode'] @@ -29,7 +34,7 @@ copyright = str(now.year) + ' Nextcloud GmbH' # built documents. # # The short X.Y version. -version = get_version().strip() +version = get_version() # The full version, including alpha/beta/rc tags. release = version @@ -47,7 +52,7 @@ html_theme_options = { html_logo = "../_shared_assets/static/logo-white.png" # substitutions go here -rst_epilog = '.. |version| replace:: %s' % version +#rst_epilog = '.. |version| replace:: %s' % version # building the versions list version_start = 26 # THIS IS THE SUPPORTED VERSION NUMBER