File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,6 +55,14 @@ def handle_error(e):
5555 os .path .join ('ssh-key.pub' ): 'ssh-rsa AAAAB' ,
5656}
5757
58+ # Get spec version from antora.yml
59+ with open ("antora.yml" , encoding = "utf-8" ) as stream :
60+ try :
61+ antora = yaml .safe_load (stream )
62+ except yaml .YAMLError as exc :
63+ print (exc )
64+ butane_latest_spec = antora .get ("asciidoc" ).get ("attributes" ).get ("butane-latest-stable-spec" )
65+
5866ret = 0
5967with tempfile .TemporaryDirectory () as tmpdocs :
6068 for path , contents in tmpfiles .items ():
@@ -72,6 +80,7 @@ def handle_error(e):
7280 # Iterate over YAML source blocks
7381 for match in matcher .finditer (filedata ):
7482 bu = match .group (1 )
83+ bu = bu .replace ('{butane-latest-stable-spec}' , butane_latest_spec )
7584 buline = filedata .count ('\n ' , 0 , match .start (1 )) + 1
7685 if not bu .startswith ('variant:' ):
7786 print (f'{ WARN } Ignoring non-Butane YAML at { filepath } :{ buline } { RESET } ' )
You can’t perform that action at this time.
0 commit comments