mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Closes #1330: Fix :confval:exclude_patterns
behavior with subdirectories in the :confval:html_static_path
.
This commit is contained in:
parent
48aeed6fd8
commit
5dcf03fb2d
3
CHANGES
3
CHANGES
@ -116,6 +116,9 @@ Bugs fixed
|
||||
* #1283: Fix a bug in the detection of changed files that would try to access
|
||||
doctrees of deleted documents.
|
||||
|
||||
* #1330: Fix :confval:`exclude_patterns` behavior with subdirectories in the
|
||||
:confval:`html_static_path`.
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
|
@ -158,18 +158,17 @@ def copy_static_entry(source, targetdir, builder, context={},
|
||||
else:
|
||||
copyfile(source, target)
|
||||
elif path.isdir(source):
|
||||
if level == 0:
|
||||
for entry in os.listdir(source):
|
||||
if entry.startswith('.'):
|
||||
continue
|
||||
copy_static_entry(path.join(source, entry), targetdir,
|
||||
builder, context, level=1,
|
||||
exclude_matchers=exclude_matchers)
|
||||
else:
|
||||
target = path.join(targetdir, path.basename(source))
|
||||
if path.exists(target):
|
||||
shutil.rmtree(target)
|
||||
shutil.copytree(source, target)
|
||||
if not path.isdir(targetdir):
|
||||
os.mkdir(targetdir)
|
||||
for entry in os.listdir(source):
|
||||
if entry.startswith('.'):
|
||||
continue
|
||||
newtarget = targetdir
|
||||
if path.isdir(path.join(source, entry)):
|
||||
newtarget = path.join(targetdir, entry)
|
||||
copy_static_entry(path.join(source, entry), newtarget,
|
||||
builder, context, level=level+1,
|
||||
exclude_matchers=exclude_matchers)
|
||||
|
||||
|
||||
_DEBUG_HEADER = '''\
|
||||
|
Loading…
Reference in New Issue
Block a user