Fix the 'No such file or directory' error

Problem: build error when `http_theme` is NOT 'openstackdocs'
Cause: `copy_assets` starts copying fonts into non-existing dir.
Measure: mkdir _static/fonts before copying

```
Extension error (os_api_ref):
Handler <function copy_assets at 0x7fd3c902f310> for event
'build-finished' threw an exception (exception: [Errno 2]
No such file or directory: '..../api-ref/build/html/_static/
fonts/glyphicons-halflings-regular.ttf')
```

Change-Id: I70d5455db3bb61060a54202c5e510493c81661d5
This commit is contained in:
Alexander Fadeev 2023-02-17 22:49:44 +02:00
parent 06cd5abff4
commit 1813e1996a
1 changed files with 3 additions and 0 deletions

View File

@ -642,6 +642,9 @@ def copy_assets(app, exception):
builders = ('html', 'readthedocs', 'readthedocssinglehtmllocalmedia')
if app.builder.name not in builders or exception:
return
dirtree = os.path.join(app.builder.outdir, '_static/fonts')
if not os.path.exists(dirtree):
os.makedirs(dirtree)
LOG.info('Copying assets: %s', ', '.join(assets))
LOG.info('Copying fonts: %s', ', '.join(fonts))
for asset in assets: