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
|
* #1283: Fix a bug in the detection of changed files that would try to access
|
||||||
doctrees of deleted documents.
|
doctrees of deleted documents.
|
||||||
|
|
||||||
|
* #1330: Fix :confval:`exclude_patterns` behavior with subdirectories in the
|
||||||
|
:confval:`html_static_path`.
|
||||||
|
|
||||||
Documentation
|
Documentation
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
@ -158,18 +158,17 @@ def copy_static_entry(source, targetdir, builder, context={},
|
|||||||
else:
|
else:
|
||||||
copyfile(source, target)
|
copyfile(source, target)
|
||||||
elif path.isdir(source):
|
elif path.isdir(source):
|
||||||
if level == 0:
|
if not path.isdir(targetdir):
|
||||||
for entry in os.listdir(source):
|
os.mkdir(targetdir)
|
||||||
if entry.startswith('.'):
|
for entry in os.listdir(source):
|
||||||
continue
|
if entry.startswith('.'):
|
||||||
copy_static_entry(path.join(source, entry), targetdir,
|
continue
|
||||||
builder, context, level=1,
|
newtarget = targetdir
|
||||||
exclude_matchers=exclude_matchers)
|
if path.isdir(path.join(source, entry)):
|
||||||
else:
|
newtarget = path.join(targetdir, entry)
|
||||||
target = path.join(targetdir, path.basename(source))
|
copy_static_entry(path.join(source, entry), newtarget,
|
||||||
if path.exists(target):
|
builder, context, level=level+1,
|
||||||
shutil.rmtree(target)
|
exclude_matchers=exclude_matchers)
|
||||||
shutil.copytree(source, target)
|
|
||||||
|
|
||||||
|
|
||||||
_DEBUG_HEADER = '''\
|
_DEBUG_HEADER = '''\
|
||||||
|
Loading…
Reference in New Issue
Block a user